errorMessage($errmsg); } else { echo $errmsg; } break; } } catch (Exception $ex) { // ignored } /* Execute the PHP internal error handler anyway. */ return false; } static function FatalErrorHandler() { global $abj404logging; $lasterror = error_get_last(); try { $errno = $lasterror['type']; $errfile = $lasterror['file']; $pluginFolder = mb_substr(ABJ404_NAME, 0, strpos(ABJ404_NAME, '/')); // if the error file does not contain the name of our plugin then we ignore it. if (mb_strpos($errfile, $pluginFolder) === false) { return false; } switch ($errno) { case E_NOTICE: // ignore these. it happens when we use the @ symbol to ignore undefined variables. break; default: $extraInfo = "(none)"; if (array_key_exists(ABJ404_PP, $_REQUEST) && array_key_exists('debug_info', $_REQUEST[ABJ404_PP])) { $extraInfo = stripcslashes(wp_kses_post(json_encode($_REQUEST[ABJ404_PP]['debug_info']))); } $errmsg = "ABJ404-SOLUTION Fatal error handler: " . stripcslashes(wp_kses_post(json_encode($lasterror))) . ', Additional info: ' . $extraInfo; if ($abj404logging != null) { $abj404logging->errorMessage($errmsg); } else { echo $errmsg; } break; } } catch (Exception $ex) { // ignored } } } ABJ_404_Solution_ErrorHandler::init();