]> git.mxchange.org Git - friendica.git/commitdiff
Add System::jsonError method for ajax call returns
authorHypolite Petovan <hypolite@mrpetovan.com>
Sat, 23 Feb 2019 20:25:41 +0000 (15:25 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 23 Feb 2019 22:32:40 +0000 (17:32 -0500)
src/Core/System.php

index 69d15a176465636549913a0816f81815f5eeb985..45a88fe0937b6d92c349d527c8985eab28e04c05 100644 (file)
@@ -176,6 +176,12 @@ class System extends BaseObject
                exit();
        }
 
+       public static function jsonError($httpCode, $data, $content_type = 'application/json')
+       {
+               header($_SERVER["SERVER_PROTOCOL"] . ' ' . $httpCode);
+               self::jsonExit($data, $content_type);
+       }
+
        /**
         * @brief Encodes content to json.
         *