bug + patch in serendipity_event_google_sitemap for static p

Found a bug? Tell us!!
Post Reply
sniff
Regular
Posts: 8
Joined: Tue Jun 20, 2006 9:54 am
Contact:

bug + patch in serendipity_event_google_sitemap for static p

Post by sniff »

There is replacement on line 297 of this plugin:

Code: Select all

$url = $serendipity['baseURL'] . preg_replace("#$path_quoted#", '', $cur['permalink']);
But, when the $path_quoted (serendipityHTTPPath) is only '/' and permalink in static pages also contains '/' (e.g. '/static/about-me.html') the output in sitemap.xml is 'http://www.example.com/staticabout-me.html' which is wrong.

The line should be:

Code: Select all

$url = $serendipity['baseURL'] . preg_replace("#$path_quoted#", '', $cur['permalink'],1);

to catch only the first occurence of http path.

Cheers,
Vasek
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Thanks for the patch! I just committed it to CVS.
Judebert
---
Website | Wishlist | PayPal
Post Reply