Bug #51961 [Fbk->Opn]: ob_start w/ str_ireplace

From: Date: Tue, 01 Jun 2010 11:31:48 +0000
Subject: Bug #51961 [Fbk->Opn]: ob_start w/ str_ireplace
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-150991@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=51961&edit=1 ID: 51961 User updated by: zane at zanehooper dot com Reported by: zane at zanehooper dot com Summary: ob_start w/ str_ireplace -Status: Feedback +Status: Open Type: Bug Package: Output Control Operating System: Apache PHP Version: 5.2.13 New Comment: Okay, the full script with PHP tags: <?php function optimizeHTML( $html ) { $badwords_array = array( ); $replacement = ''; $html = str_ireplace( $badwords_array, $replacement, $html ); return $html; } ob_start( 'optimizeHTML' ); ?> This is CapItalized. The I or C in CapItalized might be removed, as well as the T in This or The. Previous Comments: ------------------------------------------------------------------------ [2010-06-01 09:40:05] aharvey@php.net 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. ------------------------------------------------------------------------ [2010-06-01 06:02:14] zane at zanehooper dot com Description: ------------ I am making a bad word replacer using certain profanity settings. Basically, when I use str_ireplace inside of ob_start, a lot of the capitals on the page are removed (I didn't see any capitals added). I'm not sure why it is happening, but I really need this fixed. Test script: --------------- function optimizeHTML( $html ) { $html = str_ireplace( $badwords_array, $replacement, $html ); return $html; } ob_start( 'optimizeHTML' ); Expected result: ---------------- A regular page with $badwords_array replaced by $replacement Actual result: -------------- Some capitals on the page are removed ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=51961&edit=1

« previous php.bugs (#150991) next »