aboutsummaryrefslogtreecommitdiffstats
path: root/include/network.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-11-25 17:12:28 +0100
committerMario <mario@mariovavti.com>2023-11-25 17:12:28 +0100
commit0fd8e02a884a2b040dca62ab5d9674db5f6a070b (patch)
tree586ee43f32f6f14368c09026f21dcd3244ea24b6 /include/network.php
parent82e704ec5b107823c09f1387e9091adee53a4c2d (diff)
parent55c4bfb67009c598f25b1a8189604bfffa73dfbb (diff)
downloadvolse-hubzilla-0fd8e02a884a2b040dca62ab5d9674db5f6a070b.tar.gz
volse-hubzilla-0fd8e02a884a2b040dca62ab5d9674db5f6a070b.tar.bz2
volse-hubzilla-0fd8e02a884a2b040dca62ab5d9674db5f6a070b.zip
Merge branch '8.8RC'8.8
Diffstat (limited to 'include/network.php')
-rw-r--r--include/network.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/include/network.php b/include/network.php
index b8570d4f4..13339eccd 100644
--- a/include/network.php
+++ b/include/network.php
@@ -456,13 +456,14 @@ function as_return_and_die($obj,$channel) {
* @param string $msg
* optional message
*/
-function http_status($val, $msg = '') {
+function http_status($val, $msg = '',$skiplog = 0) {
if ($val >= 400)
$msg = (($msg) ? $msg : 'Error');
if ($val >= 200 && $val < 300)
$msg = (($msg) ? $msg : 'OK');
- logger(\App::$query_string . ':' . $val . ' ' . $msg);
+ if (!$skiplog)
+ logger(\App::$query_string . ':' . $val . ' ' . $msg);
header($_SERVER['SERVER_PROTOCOL'] . ' ' . $val . ' ' . $msg);
}
@@ -476,8 +477,8 @@ function http_status($val, $msg = '') {
* optional message
* @return void does not return, process is terminated
*/
-function http_status_exit($val, $msg = '') {
- http_status($val, $msg);
+function http_status_exit($val, $msg = '',$skiplog = 0) {
+ http_status($val, $msg, $skiplog);
killme();
}
@@ -2083,7 +2084,7 @@ function jsonld_document_loader($url) {
}
}
- $cachepath = 'store/[data]/ldcache';
+ $cachepath = 'store/[data]/[jsonld]';
if(!is_dir($cachepath)) {
os_mkdir($cachepath, STORAGE_DEFAULT_PERMISSIONS, true);
}
@@ -2092,7 +2093,7 @@ function jsonld_document_loader($url) {
if (file_exists($filename) && filemtime($filename) > time() - (12 * 60 * 60)) {
logger('loading ' . $filename . ' from recent cache');
- return file_get_contents($filename);
+ return json_decode(file_get_contents($filename));
}
$r = jsonld_default_document_loader($url);
@@ -2109,7 +2110,7 @@ function jsonld_document_loader($url) {
if (file_exists($filename)) {
logger('loading ' . $filename . ' from longterm cache');
- return file_get_contents($filename);
+ return json_decode(file_get_contents($filename));
}
else {
logger($filename . ' does not exist and cannot be loaded');