From:             sebastianvasile at yahoo dot com
Operating system: Linux 2.6.3
PHP version:      5.0.4
PHP Bug Type:     Strings related
Bug description:  str_ireplace not working with 1 character as search

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 bug report at http://bugs.php.net/?id=33076&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=33076&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=33076&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=33076&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=33076&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=33076&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=33076&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=33076&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=33076&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=33076&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=33076&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=33076&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=33076&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=33076&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=33076&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=33076&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=33076&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=33076&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=33076&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=33076&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=33076&r=mysqlcfg

Reply via email to