mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 18:02:18 +00:00
Merge branch 'master' into feature-28575/Softwarebereitstellung_GUI_zur_Verwaltung_von_Software
# Conflicts: # public/js/components/filter/Filter.js # public/js/plugin/FhcAlert.js # system/filtersupdate.php
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
// NOTE(chris): For security reasons 404 will be displayed the same everywhere
|
||||
?><!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>404 Page Not Found</title>
|
||||
<style type="text/css">
|
||||
|
||||
::selection { background-color: #E13300; color: white; }
|
||||
::-moz-selection { background-color: #E13300; color: white; }
|
||||
|
||||
body {
|
||||
background-color: #fff;
|
||||
margin: 40px;
|
||||
font: 13px/20px normal Helvetica, Arial, sans-serif;
|
||||
color: #4F5155;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #003399;
|
||||
background-color: transparent;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #444;
|
||||
background-color: transparent;
|
||||
border-bottom: 1px solid #D0D0D0;
|
||||
font-size: 19px;
|
||||
font-weight: normal;
|
||||
margin: 0 0 14px 0;
|
||||
padding: 14px 15px 10px 15px;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: Consolas, Monaco, Courier New, Courier, monospace;
|
||||
font-size: 12px;
|
||||
background-color: #f9f9f9;
|
||||
border: 1px solid #D0D0D0;
|
||||
color: #002166;
|
||||
display: block;
|
||||
margin: 14px 0 14px 0;
|
||||
padding: 12px 10px 12px 10px;
|
||||
}
|
||||
|
||||
#container {
|
||||
margin: 10px;
|
||||
border: 1px solid #D0D0D0;
|
||||
box-shadow: 0 0 8px #D0D0D0;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 12px 15px 12px 15px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<h1><?php echo $heading; ?></h1>
|
||||
<?php echo $message; ?>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
global $g_result;
|
||||
|
||||
// NOTE(chris): remove p tags from CI_Exceptions::show_error() function
|
||||
$msg = substr($message, 3);
|
||||
$msg = substr($msg, 0, -4);
|
||||
$msg = explode('</p><p>', $msg);
|
||||
|
||||
$msgs = [];
|
||||
|
||||
$error = [
|
||||
'heading' => $heading
|
||||
];
|
||||
|
||||
/** NOTE(chris): extract Error Number and SQL
|
||||
* @see: DB_driver.php:692
|
||||
*/
|
||||
if (substr(current($msg), 0, 14) == 'Error Number: ') {
|
||||
$code = substr(array_shift($msg), 14);
|
||||
if ($code)
|
||||
$error['code'] = (int)$code;
|
||||
$msgs[] = array_shift($msg);
|
||||
$error['sql'] = array_shift($msg);
|
||||
}
|
||||
|
||||
/** NOTE(chris): extract Line Number and Filename
|
||||
* @see: DB_driver.php:1782
|
||||
* @see: DB_driver.php:1783
|
||||
*/
|
||||
if (count($msg) >= 2) {
|
||||
if (substr(end($msg), 0, 13) == 'Line Number: ' && substr(prev($msg), 0, 10) == 'Filename: ') {
|
||||
$error['line'] = (int)substr(array_pop($msg), 13);
|
||||
$error['filename'] = substr(array_pop($msg), 10);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($msg as $m)
|
||||
$msgs[] = $m;
|
||||
|
||||
|
||||
if (count($msgs) == 1)
|
||||
$error['message'] = current($msgs);
|
||||
else
|
||||
$error['messages'] = $msgs;
|
||||
|
||||
$g_result->addError($error, FHCAPI_Controller::ERROR_TYPE_DB);
|
||||
$g_result->setStatus(FHCAPI_Controller::STATUS_ERROR);
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
global $g_result;
|
||||
|
||||
$error = [
|
||||
'message' => $message,
|
||||
'class' => get_class($exception),
|
||||
'filename' => $exception->getFile(),
|
||||
'line' => $exception->getLine()
|
||||
];
|
||||
|
||||
if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === true) {
|
||||
$error['backtrace'] = [];
|
||||
foreach (debug_backtrace() as $err) {
|
||||
if (isset($err['file']) && strpos($err['file'], realpath(BASEPATH)) !== 0) {
|
||||
$error['backtrace'][] = [
|
||||
'file' => $err['file'],
|
||||
'line' => $err['line'],
|
||||
'function' => $err['function']
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$g_result->addError($error, FHCAPI_Controller::ERROR_TYPE_EXCEPTION);
|
||||
$g_result->setStatus(FHCAPI_Controller::STATUS_ERROR);
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
global $g_result;
|
||||
|
||||
// NOTE(chris): remove p tags from CI_Exceptions::show_error() function
|
||||
$msg = substr($message, 3);
|
||||
$msg = substr($msg, 0, -4);
|
||||
$msg = explode('</p><p>', $msg);
|
||||
|
||||
$error = [
|
||||
'heading' => $heading
|
||||
];
|
||||
if (count($msg) == 1)
|
||||
$error['message'] = current($msg);
|
||||
else
|
||||
$error['messages'] = $msg;
|
||||
|
||||
$g_result->addError($error, FHCAPI_Controller::ERROR_TYPE_GENERAL);
|
||||
$g_result->setStatus(FHCAPI_Controller::STATUS_ERROR);
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
global $g_result;
|
||||
|
||||
$error = [
|
||||
'message' => $message,
|
||||
'severity' => $severity,
|
||||
'filename' => $filepath,
|
||||
'line' => $line
|
||||
];
|
||||
|
||||
if (defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === true) {
|
||||
$error['backtrace'] = [];
|
||||
foreach (debug_backtrace() as $err) {
|
||||
if (isset($err['file']) && strpos($err['file'], realpath(BASEPATH)) !== 0) {
|
||||
$error['backtrace'][] = [
|
||||
'file' => $err['file'],
|
||||
'line' => $err['line'],
|
||||
'function' => $err['function']
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO(chris): change type with severity
|
||||
$g_result->addError($error, 'php');
|
||||
|
||||
if (((E_ERROR | E_PARSE | E_COMPILE_ERROR | E_CORE_ERROR | E_USER_ERROR) & $severity) === $severity) {
|
||||
$g_result->setStatus('error');
|
||||
}
|
||||
Reference in New Issue
Block a user