Page 1 of 1

bug + patch in serendipity_event_google_sitemap for static p

Posted: Fri Sep 08, 2006 9:38 pm
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

Posted: Tue Sep 12, 2006 4:44 am
by judebert
Thanks for the patch! I just committed it to CVS.