From ccadef611d4160eb15f38a81e7dcef5b3e815cee Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 14 Oct 2021 08:04:12 +0200 Subject: [PATCH] fix PHP 8.0 error when converting an InfoLog into a ticket Cannot access offset of type string on string Also add line and file to our non-json exception handler, for easier identifying the problems --- api/src/Link.php | 2 +- api/src/loader/exception.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/api/src/Link.php b/api/src/Link.php index 386d01ca99..fe65f6e722 100644 --- a/api/src/Link.php +++ b/api/src/Link.php @@ -471,7 +471,7 @@ class Link extends Link\Storage */ static function temp_link_id($app,$id) { - return $app.':'.(!in_array($app, array(self::VFS_APPNAME,self::VFS_LINK, self::DATA_APPNAME)) ? $id : $id['name']); + return $app.':'.(!in_array($app, array(self::VFS_APPNAME,self::VFS_LINK, self::DATA_APPNAME)) || !is_array($id) ? $id : $id['name']); } /** diff --git a/api/src/loader/exception.php b/api/src/loader/exception.php index 1e7c14d37e..eb50137608 100755 --- a/api/src/loader/exception.php +++ b/api/src/loader/exception.php @@ -104,6 +104,7 @@ function egw_exception_handler($e) if(!isset($_SERVER['HTTP_HOST']) || $GLOBALS['egw_info']['flags']['no_exception_handler'] == 'cli') { echo ($headline ? $headline.': ' : '').$e->getMessage()."\n"; + echo $e->getFile().' ('.$e->getLine().")\n"; if ($GLOBALS['egw_info']['server']['exception_show_trace']) { echo $e->getTraceAsString()."\n";