From: Tim Düsterhus Date: Thu, 2 Jul 2020 13:32:19 +0000 (+0200) Subject: Correctly handle non-numeric exception codes in core.functions.php X-Git-Tag: 5.3.0_Alpha_1~171 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cdb994ab65d3d95f866fd2458f9cd79ee38a89d5;p=GitHub%2FWoltLab%2FWCF.git Correctly handle non-numeric exception codes in core.functions.php Database exceptions use the SQLSTATE as the error code. SQLSTATEs can contains letters. --- diff --git a/wcfsetup/install/files/lib/core.functions.php b/wcfsetup/install/files/lib/core.functions.php index 6e53aacb03..e125ce4458 100644 --- a/wcfsetup/install/files/lib/core.functions.php +++ b/wcfsetup/install/files/lib/core.functions.php @@ -141,7 +141,7 @@ namespace wcf\functions\exception { $message .= "======\n". 'Error Class: '.get_class($prev)."\n". 'Error Message: '.$stripNewlines($prev->getMessage())."\n". - 'Error Code: '.intval($prev->getCode())."\n". + 'Error Code: '.$stripNewlines($prev->getCode())."\n". 'File: '.$stripNewlines($prev->getFile()).' ('.$prev->getLine().')'."\n". 'Extra Information: '.($prev instanceof IExtraInformationException ? base64_encode(serialize($prev->getExtraInformation())) : '-')."\n". 'Stack Trace: '.json_encode(array_map(function ($item) { @@ -499,7 +499,7 @@ EXPLANATION; getCode()) { ?>
  • Error Code:

    -

    getCode()); ?>

    +

    getCode()); ?>