From 8d8aa4ce6625a2e34172afe548d9a0ee8bce8b4d Mon Sep 17 00:00:00 2001 From: onli Date: Thu, 1 Jul 2021 22:03:45 +0200 Subject: [PATCH] Do not print errors for PHP warnings in production mode Not even when logged in. The error output stopped the script execution. This change enables the usage of old themes, if their critical issues are fixed --- include/compat.inc.php | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/include/compat.inc.php b/include/compat.inc.php index 4b1d4ec3..fb43792c 100644 --- a/include/compat.inc.php +++ b/include/compat.inc.php @@ -214,27 +214,6 @@ if (!function_exists('errorToExceptionHandler')) { if (!$serendipity['dbConn'] || $exit) { exit; // make sure to exit in case of database connection errors or fatal errors. } - } else { - // Only display error (production blog) if an admin is logged in, else we discard the error. - - if ($serendipity['serendipityUserlevel'] >= USERLEVEL_ADMIN) { - $str = " == SERENDIPITY ERROR == "; - $str .= '

' . $type . ': '.$errStr . ' in ' . $errFile . ' on line ' . $errLine . '.' . $debug_note . '

'; - - if (headers_sent()) { - serendipity_die($str); // case HTTP headers: needs to halt with die() here, else it will path through and gets written underneath blog content, or into streamed js files, which hardly isn't seen by many users - } else { - // see global include of function in plugin_api.inc.php - // this also reacts on non eye-displayed errors with following small javascript, - // while being in tags like