From f23d0eb51e5189a5c994a7646d82cfdc9e9a76b9 Mon Sep 17 00:00:00 2001 From: Hassan Almas Date: Mon, 16 Mar 2015 11:59:24 -0400 Subject: [PATCH] Fix conflicting index bug --- jsonld.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jsonld.php b/jsonld.php index 1fdbcee..e0f8258 100644 --- a/jsonld.php +++ b/jsonld.php @@ -3695,7 +3695,9 @@ class JsonLdProcessor { // copy non-@type keywords if($property !== '@type' && self::_isKeyword($property)) { - if($property === '@index' && property_exists($subject, '@index')) { + if($property === '@index' && property_exists($subject, '@index') + && ($input->{'@index'} !== $subject->{'@index'} + || $input->{'@index'}->{'@id'} !== $subject->{'@index'}->{'@id'})) { throw new JsonLdException( 'Invalid JSON-LD syntax; conflicting @index property detected.', 'jsonld.SyntaxError', 'conflicting indexes',