Changeset:
8241ae6322a5
https://sourceforge.net/p/mrbs/hg-code/ci/8241ae6322a5dda08325862dc283e7267b9f360f
Author:
Campbell Morrison <[email protected]>
Date:
Wed Sep 28 14:03:32 2016 +0100
Log message:
Restructured
diffstat:
web/defaultincludes.inc | 1 +
web/functions.inc | 45 ---------------------------------------------
web/functions_error.inc | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 49 insertions(+), 45 deletions(-)
diffs (118 lines):
diff -r 4eb171b2a914 -r 8241ae6322a5 web/defaultincludes.inc
--- a/web/defaultincludes.inc Tue Sep 27 16:12:27 2016 +0100
+++ b/web/defaultincludes.inc Wed Sep 28 14:03:32 2016 +0100
@@ -27,6 +27,7 @@
require_once "trailer.inc";
require_once "theme.inc";
require_once "functions.inc";
+require_once "functions_error.inc";
require_once "dbsys.inc";
require_once("password_compat/password.php");
require_once "mrbs_auth.inc";
diff -r 4eb171b2a914 -r 8241ae6322a5 web/functions.inc
--- a/web/functions.inc Tue Sep 27 16:12:27 2016 +0100
+++ b/web/functions.inc Wed Sep 28 14:03:32 2016 +0100
@@ -1581,51 +1581,6 @@
echo "</span>\n";
}
-// Error handler - this is used to display serious errors such as database
-// errors without sending incomplete HTML pages. This is only used for
-// errors which "should never happen", not those caused by bad inputs.
-// If $need_header!=0 output the top of the page too, else assume the
-// caller did that. Always outputs the bottom of the page and exits.
-function fatal_error($need_header, $message, $show_form_data = true)
-{
- global $simple_trailer, $weekstarts, $view_week_number, $strftime_format;
-
- if ($need_header)
- {
- print_header(0, 0, 0, 0, "");
- }
-
- error_log("MRBS: $message");
-
- $sql_error = sql_error();
- if (!empty($sql_error))
- {
- error_log("MRBS: $sql_error");
- }
-
- $e = new Exception();
- error_log($e->getTraceAsString());
-
- if ($show_form_data)
- {
- if (!empty($_GET))
- {
- error_log("MRBS GET: " . print_r($_GET, true));
- }
- if (!empty($_POST))
- {
- error_log("MRBS POST: " . print_r($_POST, true));
- }
- }
- if (!empty($_SESSION))
- {
- error_log("MRBS SESSION: " . print_r($_SESSION, true));
- }
- echo "<p>$message</p>";
- output_trailer();
- exit;
-}
-
// Escape a PHP string for use in JavaScript
//
diff -r 4eb171b2a914 -r 8241ae6322a5 web/functions_error.inc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/web/functions_error.inc Wed Sep 28 14:03:32 2016 +0100
@@ -0,0 +1,48 @@
+<?php
+namespace MRBS;
+
+
+// Error handler - this is used to display serious errors such as database
+// errors without sending incomplete HTML pages. This is only used for
+// errors which "should never happen", not those caused by bad inputs.
+// If $need_header!=0 output the top of the page too, else assume the
+// caller did that. Always outputs the bottom of the page and exits.
+function fatal_error($need_header, $message, $show_form_data = true)
+{
+ global $simple_trailer, $weekstarts, $view_week_number, $strftime_format;
+
+ if ($need_header)
+ {
+ print_header(0, 0, 0, 0, "");
+ }
+
+ error_log("MRBS: $message");
+
+ $sql_error = sql_error();
+ if (!empty($sql_error))
+ {
+ error_log("MRBS: $sql_error");
+ }
+
+ $e = new Exception();
+ error_log($e->getTraceAsString());
+
+ if ($show_form_data)
+ {
+ if (!empty($_GET))
+ {
+ error_log("MRBS GET: " . print_r($_GET, true));
+ }
+ if (!empty($_POST))
+ {
+ error_log("MRBS POST: " . print_r($_POST, true));
+ }
+ }
+ if (!empty($_SESSION))
+ {
+ error_log("MRBS SESSION: " . print_r($_SESSION, true));
+ }
+ echo "<p>$message</p>";
+ output_trailer();
+ exit;
+}
------------------------------------------------------------------------------
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits