diff options
author | Andrew Dolgov <[email protected]> | 2011-02-18 12:28:03 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2011-02-18 12:28:03 +0300 |
commit | 685352116602e42b23484119f1fde5c6b7fef594 (patch) | |
tree | 71e17a483fe11ed70428a641d380f900141a1842 /errors.php | |
parent | d195055341368ca2b480a60b8a62c0c49966d272 (diff) |
fix fatalError() not working properly
Diffstat (limited to 'errors.php')
-rw-r--r-- | errors.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/errors.php b/errors.php index b2e0841a3..cd76d10a6 100644 --- a/errors.php +++ b/errors.php @@ -1,4 +1,5 @@ <?php + require_once "functions.php"; $ERRORS[0] = __("Unknown error"); @@ -30,4 +31,18 @@ $ERRORS[11] = "[This error is not returned by server]"; $ERRORS[12] = __("SQL escaping test failed, check your database and PHP configuration"); + + if ($_REQUEST['mode'] == 'js') { + header("Content-Type: text/plain; charset=UTF-8"); + + print "var ERRORS = [];\n"; + + foreach ($ERRORS as $id => $error) { + + $error = preg_replace("/\n/", "", $error); + $error = preg_replace("/\"/", "\\\"", $error); + + print "ERRORS[$id] = \"$error\";\n"; + } + } ?> |