aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/network.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/include/network.php b/include/network.php
index 194b50885..1b8f0e663 100644
--- a/include/network.php
+++ b/include/network.php
@@ -2014,6 +2014,21 @@ function getBestSupportedMimeType($mimeTypes = null, $acceptedTypes = false) {
*/
function jsonld_document_loader($url) {
+ switch ($url) {
+ case 'https://www.w3.org/ns/activitystreams':
+ $url = z_root() . '/library/w3org/activitystreams.jsonld';
+ break;
+ case 'https://w3id.org/identity/v1':
+ $url = z_root() . '/library/w3org/identity-v1.jsonld';
+ break;
+ case 'https://w3id.org/security/v1':
+ $url = z_root() . '/library/w3org/security-v1.jsonld';
+ break;
+ default:
+ logger('URL: ' . $url, LOGGER_DEBUG);
+ break;
+ }
+
require_once('library/jsonld/jsonld.php');
$recursion = 0;
@@ -2026,12 +2041,12 @@ function jsonld_document_loader($url) {
}
}
}
+
if($recursion > 5) {
logger('jsonld bomb detected at: ' . $url);
killme();
}
-
$cachepath = 'store/[data]/ldcache';
if(! is_dir($cachepath))
os_mkdir($cachepath, STORAGE_DEFAULT_PERMISSIONS, true);