aboutsummaryrefslogtreecommitdiffstats
path: root/include/network.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-10-14 18:15:38 +0000
committerMario <mario@mariovavti.com>2021-10-14 18:15:38 +0000
commit532b479f96eea701080d5533e5f28acab9af76ba (patch)
treeee3f05eb968888c3ceaa4cacc4b73753875b41a7 /include/network.php
parent422dfca6d7231ad77b3bb63425ce6bb9534dd01e (diff)
downloadvolse-hubzilla-532b479f96eea701080d5533e5f28acab9af76ba.tar.gz
volse-hubzilla-532b479f96eea701080d5533e5f28acab9af76ba.tar.bz2
volse-hubzilla-532b479f96eea701080d5533e5f28acab9af76ba.zip
provide local copies of the w3.org jsonld documents - addresses issue #1637
Diffstat (limited to 'include/network.php')
-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);