diff options
author | Mario <mario@mariovavti.com> | 2023-09-21 08:33:17 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2023-09-21 08:33:17 +0000 |
commit | 150174c3bb5578e0dfc20ac97a061d170fc90f5a (patch) | |
tree | 7ec97ea8ef2c6d5a7a26a528b5803d8c08560f4a /include/network.php | |
parent | 601ee0b40b4de7a27cb72341c058124d6f19a1f5 (diff) | |
download | volse-hubzilla-150174c3bb5578e0dfc20ac97a061d170fc90f5a.tar.gz volse-hubzilla-150174c3bb5578e0dfc20ac97a061d170fc90f5a.tar.bz2 volse-hubzilla-150174c3bb5578e0dfc20ac97a061d170fc90f5a.zip |
jsonld: return object instead of json string
Diffstat (limited to 'include/network.php')
-rw-r--r-- | include/network.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/network.php b/include/network.php index c95ae90a1..13339eccd 100644 --- a/include/network.php +++ b/include/network.php @@ -2084,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); } @@ -2093,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); @@ -2110,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'); |