|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43602 str_replace("[/u:$uid]", $bbcode_tpl['u_close'], $text) returns an empty string
Submitted: 2007-12-15 13:48 UTC Modified: 2007-12-26 01:00 UTC
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: furretje at hotmail dot com Assigned:
Status: No Feedback Package: Strings related
PHP Version: 5.2.5 OS: RHEL5
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: furretje at hotmail dot com
New email:
PHP Version: OS:


 [2007-12-15 13:48 UTC] furretje at hotmail dot com
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:

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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-12-18 12:02 UTC]
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.

 [2007-12-26 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 14 11:01:29 2024 UTC