From cdb994ab65d3d95f866fd2458f9cd79ee38a89d5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 2 Jul 2020 15:32:19 +0200 Subject: [PATCH] Correctly handle non-numeric exception codes in core.functions.php Database exceptions use the SQLSTATE as the error code. SQLSTATEs can contains letters. --- wcfsetup/install/files/lib/core.functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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()); ?>

  • -- 2.20.1