#27689 [NEW]: preg_replace " glitch

From: Date: Thu, 25 Mar 2004 07:05:35 +0000
Subject: #27689 [NEW]: preg_replace " glitch
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-56791@lists.php.net to get a copy of this message
From: slunta at msn dot com Operating system: Linux PHP version: 4.3.4 PHP Bug Type: Variables related Bug description: preg_replace &quot; glitch Description: ------------ There is a glitch, that does not allow &quot; to be used in preg_replace, not being replaced at all. Here's what I mean: Here is a preg_replace code, the input, and output that should be received, listed below in these text boxes I filled out Reproduce code: --------------- $input=htmlentities('<size="100%">This is a code that will change font-size using <span> tags, user-friendly style.</size>'); // This is supposed to do the proper replaces $output=preg_replace('/&lt;size=&quot;(.+)&quot;&gt;(.+)&lt;\/size&gt;/iU','<span style="font-size: $1;">$1</span>',$input); Expected result: ---------------- //Now, here is what the script is supposed to output echo '<span style="font-size: 100%">This is a code that will change font-size using <span> tags, user-friendly style.</span>'; Actual result: -------------- echo '&lt;size=&quot;100%&quot;&gt;This is a code that will change font-size using <span< tags, user-friendly style.</span>'; -- Edit bug report at http://bugs.php.net/?id=27689&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27689&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27689&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=27689&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=27689&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=27689&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=27689&r=needscript Try newer version: http://bugs.php.net/fix.php?id=27689&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=27689&r=support Expected behavior: http://bugs.php.net/fix.php?id=27689&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=27689&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=27689&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=27689&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27689&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=27689&r=dst IIS Stability: http://bugs.php.net/fix.php?id=27689&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=27689&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=27689&r=float

« previous php.bugs (#56791) next »