From 57e3928ca211a3eb4ff074b0bd2349c119e78b36 Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Thu, 24 Apr 2014 15:42:17 -0400 Subject: [PATCH] Fix bugs w/remote doc errors and add FIXME for empty property issue. --- jsonld.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/jsonld.php b/jsonld.php index 0030480..53c9b94 100644 --- a/jsonld.php +++ b/jsonld.php @@ -1,7 +1,7 @@ $remote_doc), $e); } @@ -1112,9 +1112,9 @@ class JsonLdProcessor { } } catch(Exception $e) { throw new JsonLdException( - 'Could not retrieve a JSON-LD document from the URL: ' . $url, + 'Could not retrieve a JSON-LD document from the URL.', 'jsonld.LoadDocumentError', 'loading document failed', - array('remoteDoc' => $remote_doc), $e); + array('remoteDoc' => $remote_frame), $e); } // preserve frame context @@ -3578,6 +3578,10 @@ class JsonLdProcessor { if($property === '@graph') { // add graph subjects map entry if(!property_exists($graphs, $name)) { + // FIXME: temporary hack to avoid empty property bug + if(!$name) { + $name = '"'; + } $graphs->{$name} = new stdClass(); } $g = ($graph === '@merged') ? $graph : $name;