Skip to content

Commit 2aff5f3

Browse files
author
Andrei Sandulescu
committed
- avoid fatal error if the content looks like '<html><body>You are being <a href="https://some.url">redirected</a>.</body></html>'
1 parent 9a03390 commit 2aff5f3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

LSS/XML2Array.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ protected static function &convert($node) {
110110
if(isset($child->tagName)) {
111111
$t = $child->tagName;
112112

113+
// avoid fatal error if the content looks like '<html><body>You are being <a href="https://some.url">redirected</a>.</body></html>'
114+
if(isset($output) && !is_array($output)) {
115+
continue;
116+
}
113117
// assume more nodes of same kind are coming
114118
if(!isset($output[$t])) {
115119
$output[$t] = array();

0 commit comments

Comments
 (0)