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

From: Date: Tue, 18 Dec 2007 12:02:19 +0000
Subject: #43602 [Opn->Fbk]: str_replace("[/u:$uid]", $bbcode_tpl['u_close'], $text) returns an empty string
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-120727@lists.php.net to get a copy of this message
ID: 43602 Updated by: felipe@php.net Reported By: furretje at hotmail dot com -Status: Open +Status: Feedback Bug Type: Strings related Operating System: RHEL5 PHP Version: 5.2.5 New Comment: Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. Previous Comments: ------------------------------------------------------------------------ [2007-12-15 13:48:44] furretje at hotmail dot com 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 this bug report at http://bugs.php.net/?id=43602&edit=1

« previous php.bugs (#120727) next »