From 9a760ef766bf7360fa5eec0caa0c6f879a248ab8 Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Fri, 1 Mar 2013 11:21:29 -0500 Subject: [PATCH] Fix bug with parsing @base. --- jsonld.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/jsonld.php b/jsonld.php index 47a2c35..07476ac 100644 --- a/jsonld.php +++ b/jsonld.php @@ -1,7 +1,7 @@ {'@base'}; if($base === null) { - $rval->{'@base'} = jsonld_parse_url($options['base']); + $base = $options['base']; } else if(!is_string($base)) { throw new JsonLdException( @@ -2659,9 +2659,7 @@ class JsonLdProcessor { '@context must be an absolute IRI or the empty string.', 'jsonld.SyntaxError', array('context' => $ctx)); } - else { - $rval->{'@base'} = $base; - } + $rval->{'@base'} = jsonld_parse_url($base); $defined->{'@base'} = true; }