From b3d8b564d05f91df1ec01f4e7466a66aa60e02a3 Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Wed, 27 Mar 2013 11:08:11 -0400 Subject: [PATCH] Minor clean up of IRI expansion. --- jsonld.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/jsonld.php b/jsonld.php index e8481c8..0bbe371 100644 --- a/jsonld.php +++ b/jsonld.php @@ -4635,22 +4635,20 @@ class JsonLdProcessor { } } } - } - // already absolute IRI - if(self::_isAbsoluteIri($value)) { + // already absolute IRI return $value; } - $rval = $value; - // prepend vocab if(isset($relative_to['vocab']) && $relative_to['vocab'] && property_exists($active_ctx, '@vocab')) { - $rval = $active_ctx->{'@vocab'} . $rval; + return $active_ctx->{'@vocab'} . $value; } + // prepend base - else if(isset($relative_to['base']) && $relative_to['base']) { + $rval = $value; + if(isset($relative_to['base']) && $relative_to['base']) { $rval = jsonld_prepend_base($active_ctx->{'@base'}, $rval); }