Skip to content

Commit f23d0eb

Browse files
author
Hassan Almas
committed
Fix conflicting index bug
1 parent e599042 commit f23d0eb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

jsonld.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3695,7 +3695,9 @@ protected function _createNodeMap(
36953695

36963696
// copy non-@type keywords
36973697
if($property !== '@type' && self::_isKeyword($property)) {
3698-
if($property === '@index' && property_exists($subject, '@index')) {
3698+
if($property === '@index' && property_exists($subject, '@index')
3699+
&& ($input->{'@index'} !== $subject->{'@index'}
3700+
|| $input->{'@index'}->{'@id'} !== $subject->{'@index'}->{'@id'})) {
36993701
throw new JsonLdException(
37003702
'Invalid JSON-LD syntax; conflicting @index property detected.',
37013703
'jsonld.SyntaxError', 'conflicting indexes',

0 commit comments

Comments
 (0)