]> git.wh0rd.org - tt-rss.git/blobdiff - errors.php
backend/viewfeed: fix feed checking for validity
[tt-rss.git] / errors.php
index 9fb028ecac9024e710d02f084dc9797545c615ac..cd76d10a680261f72e74832cb63724306731b598 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+       require_once "functions.php";
 
        $ERRORS[0] = __("Unknown error");
 
@@ -12,7 +13,7 @@
 
        $ERRORS[4] = __("Frontend sanity check failed.");
 
-       $ERRORS[5] = __("Incorrect database schema version. &lt;a href='update.php'&gt;Please update&lt;/a&gt;.");
+       $ERRORS[5] = __("Incorrect database schema version. &lt;a href='db-updater.php'&gt;Please update&lt;/a&gt;.");
 
        $ERRORS[6] = __("Request not authorized.");
 
        $ERRORS[10] = __("Your version of MySQL is not currently supported. Please see 
                official site for more information.");
 
-       $ERRORS[11] = __("Sanity check request received twice. You could be running
-               Firebug or some other disrupting extension. Please turn it off.");
+       $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";
+               }
+       }
 ?>