Page 1 of 1

Little Twak to guestbook plugin

Posted: Mon Jul 13, 2009 12:18 pm
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

Re: Little Twak to guestbook plugin

Posted: Mon Jul 13, 2009 12:39 pm
by garvinhicking
Hi!

Thanks a lot, committed!

Regards,
Garvin

Re: Little Twak to guestbook plugin

Posted: Mon Aug 03, 2009 9:09 am
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.

Re: Little Twak to guestbook plugin

Posted: Mon Aug 03, 2009 4:31 pm
by garvinhicking
Hi!

Committed, thanks a heap!

Regards,
Garvin