From: Alexander Ebert Date: Thu, 25 Feb 2016 20:55:32 +0000 (+0100) Subject: Discard previous output when an exception is thrown X-Git-Tag: 3.0.0_Beta_1~2030^2~82 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f8434d25950d766c340e9381f5a825b403a05ca9;p=GitHub%2FWoltLab%2FWCF.git Discard previous output when an exception is thrown --- diff --git a/wcfsetup/install/files/lib/system/WCF.class.php b/wcfsetup/install/files/lib/system/WCF.class.php index f58f7851fe..bc371f36af 100644 --- a/wcfsetup/install/files/lib/system/WCF.class.php +++ b/wcfsetup/install/files/lib/system/WCF.class.php @@ -237,6 +237,12 @@ class WCF { * @param \Exception $e */ public static final function handleException($e) { + if (ob_get_level()) { + // discard any output generated before the exception occured, prevents exception + // being hidden inside HTML elements and therefore not visible in browser output + ob_clean(); + } + // backwards compatibility if ($e instanceof IPrintableException) { $e->show();