#29606 [Com]: php_strip_whitespace() stdout problems
| From: | nadie_20 at hotmail dot com | Date: | Wed, 22 Sep 2004 21:10:09 +0000 |
| Subject: | #29606 [Com]: php_strip_whitespace() stdout problems | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-66571@lists.php.net to get a copy of this message | ||
ID: 29606
Comment by: nadie_20 at hotmail dot com
Reported By: dave@php.net
Status: Closed
Bug Type: Output Control
PHP Version: 5CVS-2004-08-10 (dev)
New Comment:
lñllllllllllllllll
Previous Comments:
------------------------------------------------------------------------
[2004-08-11 14:46:01] iliaa@php.net
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2004-08-10 23:15:12] dave@php.net
Description:
------------
The proto and description of php_strip_whitespace() indicate it should
return a stripped string. It does not do this and instead outputs the
stripped code to stdout.
It looks like the function IS intended to return the stripped string as
the code uses output buffering, but the problem lies in php_strip().
Unlike highlight_file() which uses zend_printf()'s and ZEND_PUTC()'s
and what-have-you so output buffering works and the result is captured,
php_strip() is hardcoded to output to stdout which means the output
buffering intended for php_strip_whitespace() doesn't work and an empty
string is returned for this function.
It also means, for Apache, since stdout goes nowhere (I think?),
nothing is even outputted to the browser.
Fixing this would also close #28280. (same function, different issue)
Reproduce code:
---------------
<?php
/* ... */
var_dump(php_strip_whitespace($_SERVER['SCRIPT_FILENAME']));
?>
Expected result:
----------------
string(63) "<?php
var_dump(php_strip_whitespace($_SERVER['SCRIPT_FILENAME'])); ?>"
Actual result:
--------------
CLI:
<?php
var_dump(php_strip_whitespace($_SERVER['SCRIPT_FILENAME'])); ?>
string(0) ""
Apache:
string(0) ""
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29606&edit=1