PDA

View Full Version : Small bug in phpdigRewriteUrl()


Goth
02-10-2004, 04:03 PM
Excuse my poor English but I'm French...

I have seen that some site doesn't work with phpdig, so I search the reason why and I find that in function phpdigRewriteUrl(), when $path == '/' the line $retour['path'] = ereg_replace('(.*[^/])/?$','\\1/',ereg_replace('^/(.*)','\\1',ereg_replace("/+","/",$path))); return a wrong string, I have seen this on one of my website http://www.evanescence-music.com.
So I have juste made a little update of this function by replacing this line by this :

if ($path != '/')
$retour['path'] = ereg_replace('(.*[^/])/?$','\\1/',ereg_replace('^/(.*)','\\1',ereg_replace("/+","/",$path)));
else
$retour['path'] = '';

And now it works well...