View Single Post
Old 02-10-2004, 03:03 PM   #1
Goth
Green Mole
 
Join Date: Feb 2004
Location: FRANCE
Posts: 1
Small bug in phpdigRewriteUrl()

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...
Goth is offline   Reply With Quote