note 119938 added to function.ob-start
| From: | mbutscher at gmx dot de | Date: | Sat, 24 Sep 2016 00:52:45 +0000 |
| Subject: | note 119938 added to function.ob-start | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-206658@lists.php.net to get a copy of this message | ||
In case of an error the contents of the output buffer are shown along with the error message. If it
is really important that this does never happen, you can do the following (but this also eats up the
error message):
<?php
$outputbufferOutput = FALSE;
function switchableOutputHandler($buffer) {
global $outputbufferOutput;
if ($outputbufferOutput)
return $buffer;
else
return "";
}
function internob_start() {
global $outputbufferOutput;
$outputbufferOutput = FALSE;
return ob_start("switchableOutputHandler");
}
function internob_get_clean() {
global $outputbufferOutput;
$outputbufferOutput = TRUE;
$result = ob_get_clean();
$outputbufferOutput = FALSE;
return $result;
}
?>
You can then use internob_start() and internob_get_clean() instead of ob_start() and ob_get_clean().
Other functions can be replaced accordingly.
----
Server IP: 72.52.91.14
Probable Submitter: 79.200.65.182
----
Manual Page -- http://php.net/manual/en/function.ob-start.php
Edit -- https://master.php.net/note/edit/119938
Del: integrated -- https://master.php.net/note/delete/119938/integrated
Del: useless -- https://master.php.net/note/delete/119938/useless
Del: bad code -- https://master.php.net/note/delete/119938/bad+code
Del: spam -- https://master.php.net/note/delete/119938/spam
Del: non-english -- https://master.php.net/note/delete/119938/non-english
Del: in docs -- https://master.php.net/note/delete/119938/in+docs
Del: other reasons-- https://master.php.net/note/delete/119938
Reject -- https://master.php.net/note/reject/119938
Search -- https://master.php.net/manage/user-notes.php