Skip to content

Commit fc24e6e

Browse files
authored
Merge pull request #6 from AndrewStarlike/master
- avoid fatal error
2 parents 9a03390 + 2aff5f3 commit fc24e6e

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)