From: nek at capsule dot org
Operating system: Linux
PHP version: 4.3.2
PHP Bug Type: Regexps related
Bug description: ereg_replace fails to strtolower replaced string
Description:
------------
Hi,
i'm trying to replace a portion of string by its strtolowered equivalent
see reproduce code and results below : it should give
"href=javascript:comment()" but only "HREF" is lowered, not the matching
string \1
Reproduce code:
---------------
<?php
$newsaff = "<A HREF=\"JAVASCRIPT:COMMENT()\">THIS IS A TEST LINK</A>";
$newsaff =
ereg_replace("HREF=\"([^\"]+)\"",strtolower("HREF=\"\\1\""),$newsaff);
print $newsaff;
?>
Expected result:
----------------
<A href="javascript:comment()">THIS IS A TEST LINK</A>
Actual result:
--------------
<A href="JAVASCRIPT:COMMENT()">THIS IS A TEST LINK</A>
--
Edit bug report at http://bugs.php.net/?id=24645&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=24645&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=24645&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=24645&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=24645&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=24645&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=24645&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=24645&r=support
Expected behavior: http://bugs.php.net/fix.php?id=24645&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=24645&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=24645&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=24645&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24645&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=24645&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=24645&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=24645&r=gnused