#26524 [NEW]: eregi_replace and backslash

From: Date: Thu, 04 Dec 2003 15:18:31 +0000
Subject: #26524 [NEW]: eregi_replace and backslash
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-51697@lists.php.net to get a copy of this message
From: boccara at netvision dot net dot il Operating system: win2k server sp4 PHP version: 4.3.3 PHP Bug Type: Reproducible crash Bug description: eregi_replace and backslash Description: ------------ the eregi_replace seems to have a problem with replacing backslach. I made a function that should replace a \ with \\ and I got this error message: <b>Warning</b>: eregi_replace(): REG_EESCAPE:Ptrailing backslash (\) in .... Reproduce code: --------------- function JavascriptEncode($str1) { $str1 = eregi_replace(chr(92),chr(92).chr(92),$str1); return $str1; } this fonction doesn't work. function JavascriptEncode($str1) { $str1 = eregi_replace(chr(92).chr(92),chr(92).chr(92),$str1); return $str1; } this fonction replace \ by \\ ( it works, but why ???) -- Edit bug report at http://bugs.php.net/?id=26524&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26524&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26524&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=26524&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=26524&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=26524&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=26524&r=needscript Try newer version: http://bugs.php.net/fix.php?id=26524&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=26524&r=support Expected behavior: http://bugs.php.net/fix.php?id=26524&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=26524&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=26524&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=26524&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26524&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=26524&r=dst IIS Stability: http://bugs.php.net/fix.php?id=26524&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=26524&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=26524&r=float

« previous php.bugs (#51697) next »