Fix conflicting index bug

This commit is contained in:
Hassan Almas 2015-03-16 11:59:24 -04:00
parent e599042c7d
commit f23d0eb51e

View file

@ -3695,7 +3695,9 @@ class JsonLdProcessor {
// copy non-@type keywords // copy non-@type keywords
if($property !== '@type' && self::_isKeyword($property)) { 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( throw new JsonLdException(
'Invalid JSON-LD syntax; conflicting @index property detected.', 'Invalid JSON-LD syntax; conflicting @index property detected.',
'jsonld.SyntaxError', 'conflicting indexes', 'jsonld.SyntaxError', 'conflicting indexes',