Little Twak to guestbook plugin

Creating and modifying plugins.
Post Reply
WMK
Regular
Posts: 32
Joined: Mon Jun 22, 2009 11:14 am
Contact:

Little Twak to guestbook plugin

Post by WMK »

Hi, i noticed that guestbook entries with no http:// in the url generate a relative url to my domain, so the link provided by the entry is useless.

i changed line 394 in serendipity_event_guestbook.php:

Code: Select all

$entry['homepage']            = strpos($entry['homepage'],'http://') !== 0 
     ? 'http://' . $entry['homepage'] 
     : $entry['homepage'];
hth
Viele Grüße,

Werner
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Little Twak to guestbook plugin

Post by garvinhicking »

Hi!

Thanks a lot, committed!

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
WMK
Regular
Posts: 32
Joined: Mon Jun 22, 2009 11:14 am
Contact:

Re: Little Twak to guestbook plugin

Post by WMK »

Unfortunately i didn't check for empty urls, so a "http://" is added then, too.

Changing to

Code: Select all

$entry['homepage']  = !empty($entry['homepage']) && strpos($entry['homepage'],'http://') !== 0 && strpos($entry['homepage'],'https://') !== 0
    ? 'http://' . $entry['homepage']
    : $entry['homepage'];
fixes this.

Also added a check for https urls.
Viele Grüße,

Werner
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Little Twak to guestbook plugin

Post by garvinhicking »

Hi!

Committed, thanks a heap!

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply