PhpDig.net

PhpDig.net (http://www.phpdig.net/forum/index.php)
-   Bug Tracker (http://www.phpdig.net/forum/forumdisplay.php?f=27)
-   -   Small bug in phpdigRewriteUrl() (http://www.phpdig.net/forum/showthread.php?t=505)

Goth 02-10-2004 03:03 PM

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...


All times are GMT -8. The time now is 08:56 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.