From cfac4937b19936ea95c87e2898d4baeb0dcc673d Mon Sep 17 00:00:00 2001 From: Buchholz Date: Sat, 9 Oct 2021 20:09:12 +0200 Subject: [PATCH] common.php --- include/common.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/include/common.php b/include/common.php index abdc1d4..e42473b 100644 --- a/include/common.php +++ b/include/common.php @@ -157,7 +157,8 @@ if ( function_exists('date_default_timezone_set') ){ * @return false Always returns false so the standard PHP error handler is also used * */ -function showError($errno, $errmsg, $filename, $linenum, $vars, $backtrace=null){ +function showError($errno, $errmsg, $filename, $linenum, $vars=null, $backtrace=null): bool +{ global $wbErrorBuffer, $addon_current_id, $page, $addon_current_version, $config, $addonFolderName; static $reported = []; @@ -187,7 +188,7 @@ function showError($errno, $errmsg, $filename, $linenum, $vars, $backtrace=null) // since we supported older versions of php, there may be a lot of strict errors if( $errno === E_STRICT ){ - return; + return true; } //get the backtrace and function where the error was thrown @@ -226,7 +227,7 @@ function showError($errno, $errmsg, $filename, $linenum, $vars, $backtrace=null) } //if it's a core error, it should be in the include folder - }elseif( strpos($filename, '/include/') === false ){ + }elseif(!str_contains($filename, '/include/')){ return false; } @@ -412,7 +413,7 @@ function msg(){ /** - * add message only if admin user is logged in + * add message only if admin user is logged in * @since 5.2 * */ @@ -575,7 +576,7 @@ function IncludeScript($file, $include_variation = 'include_once', $globals=arra //check to see if it exists $include_variation = str_replace('_if', '', $include_variation, $has_if); if( $has_if && !$exists ){ - return; + return true; } //check for fatal errors @@ -680,7 +681,7 @@ function pre($mixed){ * @deprecated 2.6 */ function showArray($mixed){ - trigger_error('Deprecated function showArray(). Use pre() instead'); + trigger_error('Deprecated function showArray(). Use pre() instead'); }