[Phpfreechat-svn] SF.net SVN: phpfreechat: [699] trunk/src/pfctools.php
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-08-25 15:19:56
|
Revision: 699 Author: kerphi Date: 2006-08-25 08:19:51 -0700 (Fri, 25 Aug 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=699&view=rev Log Message: ----------- [en] Bug fix: fix an infinit loop on windows platform when calculating relative path. [fr] Bug fix?\194?\160: r?\195?\169soud une boucle infinie sous windows lorsque je calculais les chemins relatifs. Modified Paths: -------------- trunk/src/pfctools.php Modified: trunk/src/pfctools.php =================================================================== --- trunk/src/pfctools.php 2006-08-23 16:36:49 UTC (rev 698) +++ trunk/src/pfctools.php 2006-08-25 15:19:51 UTC (rev 699) @@ -64,7 +64,10 @@ $res = ""; //echo $p1."<br>"; //echo $p2."<br>"; - while( $p1 != "" && $p1 != "/" && strpos($p2, $p1) !== 0) + while( $p1 != "" && + $p1 != "/" && // for unix root dir + !preg_match("/[a-z]\:\\\/i",$p1) && // for windows rootdir + strpos($p2, $p1) !== 0) { $res .= "../"; $p1 = dirname($p1); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |