Skip to content

Commit

Permalink
Merge pull request #636 from magefan/magefan-patch-42
Browse files Browse the repository at this point in the history
invalid argument supplied for foreach() in  ShortContentExtractor.php
  • Loading branch information
magefan authored Dec 26, 2024
2 parents bd8a930 + f9b014b commit ed7d1c1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Model/ShortContentExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ private function setPageBreakOnLen(string $content, $len): string
return;
}

foreach ($node->childNodes as $child) {
$processNode($child);
if ($node->childNodes) {
foreach ($node->childNodes as $child) {
$processNode($child);
}
}

if ($node->nodeType === XML_TEXT_NODE) {
Expand Down

0 comments on commit ed7d1c1

Please sign in to comment.