#43602 [NEW]: str_replace("[/u:$uid]", $bbcode_tpl['u_close'], $text) returns an empty string

From: Date: Sat, 15 Dec 2007 13:48:44 +0000
Subject: #43602 [NEW]: str_replace("[/u:$uid]", $bbcode_tpl['u_close'], $text) returns an empty string
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-120666@lists.php.net to get a copy of this message
From: furretje at hotmail dot com Operating system: RHEL5 PHP version: 5.2.5 PHP Bug Type: Strings related Bug description: str_replace("[/u:$uid]", $bbcode_tpl['u_close'], $text) returns an empty string Description: ------------ If I use phpBB2 forum tags like [b][/b] or [u][/u] in a message and the text between the tags is longer then about 148 characters, the whole message becomes empty. This problem occurs in php version 5.2.x (x=0,4,5), but not in version 4.4.7 or 5.1.6. When I upgraded my server to 5.2.5, I discovered this problem. Of course, I first searched for a solution on the phpBB forum, but I found nothing related to this. Am I the first using an older phpBB forum with a new php version, and long texts between tags? Reproduce code: --------------- type message in a phpBB2.0.x forum: [u]012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789[/u] includes/bbcode.php, function bbencode_second_pass($text, $uid): $text = str_replace("[u:$uid]", $bbcode_tpl['u_open'], $text); $text = str_replace("[/u:$uid]", $bbcode_tpl['u_close'], $text); the first str_replace goes well, the second one makes $text empty. Expected result: ---------------- both string replacements are done well and the message is shown. Actual result: -------------- the second string replacement makes $text empty and no message is shown. -- Edit bug report at http://bugs.php.net/?id=43602&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=43602&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=43602&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=43602&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=43602&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=43602&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=43602&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=43602&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=43602&r=needscript Try newer version: http://bugs.php.net/fix.php?id=43602&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=43602&r=support Expected behavior: http://bugs.php.net/fix.php?id=43602&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=43602&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=43602&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=43602&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43602&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=43602&r=dst IIS Stability: http://bugs.php.net/fix.php?id=43602&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=43602&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=43602&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=43602&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=43602&r=mysqlcfg

« previous php.bugs (#120666) next »