ID:               33076
 Updated by:       [EMAIL PROTECTED]
 Reported By:      sebastianvasile at yahoo dot com
-Status:           Open
+Status:           Closed
 Bug Type:         Strings related
 Operating System: Linux 2.6.3
 PHP Version:      5.0.4
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:
------------------------------------------------------------------------

[2005-05-20 16:16:28] sebastianvasile at yahoo dot com

I think I found what crashes it:

I have:
str_ireplace("t", "ttttt", "This is a text");

I get: crash.

************************************************

I have:
str_ireplace("t", "tttt", "This is a text");

I get: tttthis is a ttttext (final t not replaced)

***********************************************

I have:
str_ireplace("Z", "zzzzzz", "zThis is a text");

I get: zzzzzzThis is a

One more "z" in replacement will crash.
*********************************************

Seems like the original string size is not increased.

------------------------------------------------------------------------

[2005-05-20 15:52:16] sebastianvasile at yahoo dot com

I tested this build:

May 20 2005 10:18:50 on my WinMe machine.

I cannot make a linux test (like the original report) because I cannot
administrate the server.

It's not working on my machine, it gives an error in Kernel32.dll
error.

I found a strange behaviour:

If I have:

"this is a text" and try to replace the "t"'s with something else than
it works fine. (but str_replace could be used instead)

If I have:

"This is a text" (at least one "t" in uppercase) it crashes.

It works fine for 2 characters.

I hope I'm doing this report right as I don't want to cause more
trouble than to help.

------------------------------------------------------------------------

[2005-05-20 11:35:10] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip

I can not reproduce this.


------------------------------------------------------------------------

[2005-05-20 11:32:57] sebastianvasile at yahoo dot com

Description:
------------
str_ireplace is causing a "Page cannot be displayed" when I pass a
single letter as $search.

Reproduce code:
---------------
$value = str_ireplace($keyword, "<font
color=\"red\">".strtoupper($keyword)."</font>", $value);

I want to use this code for highlighting $keyword found in $value.

$value is a large string.

It works fine if $keyword has more than one caracter.
It works fine if I use str_replace.

If I pass only one character I get a Page cannot be displayed

Expected result:
----------------
String with characters replaced.

Actual result:
--------------
The page cannot be displayed, in IE 6.0.2800.1106, on Win Me


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=33076&edit=1

Reply via email to