]> git.mxchange.org Git - friendica.git/blobdiff - include/network.php
New option to permit crawlers
[friendica.git] / include / network.php
index 02b2d7c2aed1c25325754b154a8677d6dcf6e8d7..2815e1ab851e7a4f094e966b13332cfe0f8241ad 100644 (file)
@@ -309,16 +309,25 @@ function xml_status($st, $message = '') {
 
 
 if(! function_exists('http_status_exit')) {
-function http_status_exit($val) {
-
+function http_status_exit($val, $description = array()) {
     $err = '';
-       if($val >= 400)
+       if($val >= 400) {
                $err = 'Error';
+               if (!isset($description["title"]))
+                       $description["title"] = $err." ".$val;
+       }
        if($val >= 200 && $val < 300)
                $err = 'OK';
 
        logger('http_status_exit ' . $val);
        header($_SERVER["SERVER_PROTOCOL"] . ' ' . $val . ' ' . $err);
+
+       if (isset($description["title"])) {
+               $tpl = get_markup_template('http_status.tpl');
+               echo replace_macros($tpl, array('$title' => $description["title"],
+                                               '$description' => $description["description"]));
+       }
+
        killme();
 
 }}