⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.72
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
psa-pear
/
pear
/
php
/
Horde
/
View File Name :
ErrorHandler.php
* @category Horde * @license http://www.horde.org/licenses/lgpl21 LGPL-2.1 * @package Core */ class Horde_ErrorHandler { /** * Aborts with a fatal error, displaying debug information to the user. * * @param mixed $error Either a string or an object with a getMessage() * method (e.g. PEAR_Error, Exception). */ public static function fatal($error) { global $registry; if (is_object($error)) { switch (get_class($error)) { case 'Horde_Exception_AuthenticationFailure': $auth_app = !$registry->clearAuthApp($error->application); if ($auth_app && $registry->isAuthenticated(array('app' => $error->application, 'notransparent' => true))) { break; } try { Horde::log($error, 'NOTICE'); } catch (Exception $e) {} if (Horde_Cli::runningFromCLI()) { $cli = new Horde_Cli(); $cli->fatal($error); } $params = array(); if ($registry->getAuth()) { $params['app'] = $error->application; } switch ($error->getCode()) { case Horde_Auth::REASON_MESSAGE: $params['msg'] = $error->getMessage(); $params['reason'] = $error->getCode(); break; } $logout_url = $registry->getLogoutUrl($params); /* Clear authentication here. Otherwise, there might be * issues on the login page since we would otherwise need * to do session token checking (which might not be * available, so logout won't happen, etc...) */ if ($auth_app && array_key_exists('app', $params)) { $registry->clearAuth(); } $logout_url->redirect(); } } try { Horde::log($error, 'EMERG'); } catch (Exception $e) {} try { $cli = Horde_Cli::runningFromCLI(); } catch (Exception $e) { die($e); } if ($cli) { $cli = new Horde_Cli(); $cli->fatal($error); } if (!headers_sent()) { header('Content-type: text/html; charset=UTF-8'); } echo <<< HTML
Horde :: Fatal Error
HTML; ob_start(); try { $admin = (isset($registry) && $registry->isAdmin()); echo '
' . Horde_Core_Translation::t("A fatal error has occurred") . '
'; if (is_object($error) && method_exists($error, 'getMessage')) { echo '
' . htmlspecialchars($error->getMessage()) . '
'; } elseif (is_string($error)) { echo '
' . htmlspecialchars($error) . '
'; } if ($admin) { if ($error instanceof Throwable || $error instanceof Exception) { $trace = $error; $file = $error->getFile(); $line = $error->getLine(); } else { $trace = debug_backtrace(); $calling = array_shift($trace); $file = $calling['file']; $line = $calling['line']; } printf(Horde_Core_Translation::t("in %s:%d"), $file, $line); echo '
' . strval(new Horde_Support_Backtrace($trace)) . '
'; if (is_object($error)) { echo '
' . Horde_Core_Translation::t("Details") . '
'; echo '
' . Horde_Core_Translation::t("The full error message is logged in Horde's log file, and is shown below only to administrators. Non-administrative users will not see error details.") . '
'; ob_flush(); flush(); echo '
' . htmlspecialchars(print_r($error, true)) . '
'; } } else { echo '
' . Horde_Core_Translation::t("Details have been logged for the administrator.") . '
'; } } catch (Exception $e) { die($e); } ob_end_flush(); echo ''; exit(1); } /** * PHP legacy error handling (non-Exceptions). * * @param integer $errno See set_error_handler(). * @param string $errstr See set_error_handler(). * @param string $errfile See set_error_handler(). * @param integer $errline See set_error_handler(). * @param array $errcontext See set_error_handler(). */ public static function errorHandler($errno, $errstr, $errfile, $errline, $errcontext) { $er = error_reporting(); // Calls prefixed with '@'. if ($er == 0) { // Must return false to populate $php_errormsg (as of PHP 5.2). return false; } if (!($er & $errno) || !class_exists('Horde_Log')) { return; } $options = array(); try { switch ($errno) { case E_WARNING: case E_USER_WARNING: case E_RECOVERABLE_ERROR: $priority = Horde_Log::WARN; break; case E_NOTICE: case E_USER_NOTICE: $priority = Horde_Log::NOTICE; break; case E_STRICT: $options['notracelog'] = true; $priority = Horde_Log::DEBUG; break; default: $priority = Horde_Log::DEBUG; break; } Horde::log(new ErrorException('PHP ERROR: ' . $errstr, 0, $errno, $errfile, $errline), $priority, $options); } catch (Exception $e) {} } /** * Catch fatal errors. */ public static function catchFatalError() { $error = error_get_last(); if ($error['type'] == E_ERROR) { self::fatal(new ErrorException( $error['message'], 0, $error['type'], $error['file'], $error['line'] )); } } }