ID: 15552
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
-Status: Open
+Status: Bogus
Bug Type: Strings related
Operating System: SunOS no14 / Linux merlin 2.4.2
PHP Version: 4.0.6
New Comment:
I cannot reproduce this. I tried to following code snippet:
$f=file("http://www.excelsior.cc/js/dqm_script.js");
$f=implode("", $f);
print str_replace(";", ";\n", $f);
Works as expected. The problem is not in str_replace.
Previous Comments:
------------------------------------------------------------------------
[2002-02-14 09:15:10] [EMAIL PROTECTED]
if(isset($wrapme)){
$thescript=str_replace(";", ";\n", $thescript);
}
This is my solution when trying to wade through horribly compact
"all-on-one-line" style JavaScript: $thescript is read from the JS-URL
with fopen() and I'm trying to wrap it on semicolons. Result:
var q22="";var q23="";
becomes
var q22="
"
;
var q23="
"
;
(evident on
http://www.hallvord.com/opera/sitetest.php?urlurl=http%3A%2F%2Fwww.excelsior.cc%2Fjs%2Fdqm_script.js&wrapme=Wrap+this+script%21&startscr=0&endscr=2265
)
Have I misunderstood something here or is it a bug that str_replace
with ';' as search also finds "" ? Tried preg_replace with the same
result, even when given a \x hex code input. Reproduced on two
different versions of PHP (most recent being 4.0.6 but I'm not in
charge of upgrading the servers so I can't test it in later builds) and
two different server setups.
I hope this is a genuine bug - if not I'm sorry!
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=15552&edit=1