mirror of
https://github.com/processwire/processwire.git
synced 2025-08-20 21:42:23 +02:00
Add PR #206 Fix: WireCache output buffer not closed
This commit is contained in:
@@ -342,14 +342,16 @@ class WireCache extends Wire {
|
|||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
|
|
||||||
|
try {
|
||||||
if(count($args)) {
|
if(count($args)) {
|
||||||
$value = call_user_func_array($func, $args);
|
$value = call_user_func_array($func, $args);
|
||||||
} else {
|
} else {
|
||||||
$value = $func();
|
$value = $func();
|
||||||
}
|
}
|
||||||
|
} finally { // PHP 5.5+
|
||||||
$out = ob_get_contents();
|
$out = ob_get_contents();
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
|
}
|
||||||
|
|
||||||
if(empty($value) && !empty($out)) $value = $out;
|
if(empty($value) && !empty($out)) $value = $out;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user