From: [EMAIL PROTECTED] Operating system: Linux and Win2K PHP version: 4.2.0 PHP Bug Type: Regexps related Bug description: ereg_replace returns wrong characters
This is small script for testing. <?php $pat = "(^|&)foo(&|$)"; $string = "foo"; echo ereg_replace($pat, "\\1", $string); ?> In PHP <= 4.1.x, this script returns empty string. But, PHP 4.2.0 and PHP 4.2.1RC1 return '\1'. The return value in PHP >= 4.2.0 should be corrected. ereg_replace() is used for session id propagation in GET mode of PHPlib. It is not work well because it is affected by this problem. -- Edit bug report at http://bugs.php.net/?id=16959&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=16959&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=16959&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=16959&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=16959&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=16959&r=support Expected behavior: http://bugs.php.net/fix.php?id=16959&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=16959&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=16959&r=submittedtwice