Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/MicrodataPhpDOMElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function properties() {
foreach ($this->itemRef() as $itemref) {
$children = $this->ownerDocument->xpath()->query('//*[@id="'.$itemref.'"]');
foreach($children as $child) {
$this->traverse($child, $toTraverse, $props, $this);
$this->traverse($child, $toTraverse, $props, $this, true);
}
}
while (count($toTraverse)) {
Expand Down Expand Up @@ -169,7 +169,7 @@ protected function tokenList($string) {
* See comment for MicrodataPhp:getObject() for an explanation of closure use
* in this library.
*/
protected function traverse($node, &$toTraverse, &$props, $root) {
protected function traverse($node, &$toTraverse, &$props, $root, $itemref = false) {
foreach ($toTraverse as $i => $elem) {
if ($elem->isSameNode($node)){
unset($toTraverse[$i]);
Expand All @@ -181,7 +181,7 @@ protected function traverse($node, &$toTraverse, &$props, $root) {
//@todo Add support for property name filtering.
$props[] = $node;
}
if ($node->itemScope()) {
if (!$itemref && $node->itemScope()) {
return;
}
}
Expand Down