#39298 [NEW]: Removing "/" slash works bad

From: Date: Sun, 29 Oct 2006 14:37:12 +0000
Subject: #39298 [NEW]: Removing "/" slash works bad
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-104135@lists.php.net to get a copy of this message
From: dankeris at gmail dot com Operating system: Kubuntu 6.10 PHP version: 5.1.6 PHP Bug Type: Scripting Engine problem Bug description: Removing "/" slash works bad Description: ------------ Instead of deleteting "/" char it makes a mysterious character (ord returns 000). ="" =null =false makes all the same thing Reproduce code: --------------- <? function return_url() { $url = "labas/"; if(strpos($url,"/")===0) $url[0]=""; $len = (strlen($url)-1); if(strrpos($url,"/")===$len) $url[$len]=""; return $url; } var_dump(return_url()); ?> Expected result: ---------------- string(6) "labas{strange char here}" Actual result: -------------- s -- Edit bug report at http://bugs.php.net/?id=39298&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39298&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39298&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39298&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=39298&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=39298&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=39298&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=39298&r=needscript Try newer version: http://bugs.php.net/fix.php?id=39298&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=39298&r=support Expected behavior: http://bugs.php.net/fix.php?id=39298&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=39298&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=39298&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=39298&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39298&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=39298&r=dst IIS Stability: http://bugs.php.net/fix.php?id=39298&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=39298&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=39298&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=39298&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=39298&r=mysqlcfg

« previous php.bugs (#104135) next »