@@ -1078,7 +1078,7 @@ public function parseH(\DOMElement $e, $is_backcompat = false, $has_nested_mf =
10781078 $ photo = $ this ->parseImpliedPhoto ($ e );
10791079
10801080 if ($ photo !== false ) {
1081- $ return ['photo ' ][] = $ this -> resolveUrl ( $ photo) ;
1081+ $ return ['photo ' ][] = $ photo ;
10821082 }
10831083
10841084 }
@@ -1167,13 +1167,13 @@ public function parseImpliedPhoto(\DOMElement $e) {
11671167
11681168 $ xpaths = array (
11691169 // .h-x>img[src]:only-of-type:not[.h-*]
1170- './img[not(contains(concat(" ", @class), " h-")) and count(../img) = 1] ' ,
1170+ './img[not(contains(concat(" ", @class), " h-")) and count(../img) = 1 and @src ] ' ,
11711171 // .h-x>object[data]:only-of-type:not[.h-*]
1172- './object[not(contains(concat(" ", @class), " h-")) and count(../object) = 1] ' ,
1172+ './object[not(contains(concat(" ", @class), " h-")) and count(../object) = 1 and @data ] ' ,
11731173 // .h-x>:only-child:not[.h-*]>img[src]:only-of-type:not[.h-*]
1174- './*[not(contains(concat(" ", @class), " h-")) and count(../*) = 1 and count(img) = 1]/img[not(contains(concat(" ", @class), " h-"))] ' ,
1174+ './*[not(contains(concat(" ", @class), " h-")) and count(../*) = 1 and count(img) = 1]/img[not(contains(concat(" ", @class), " h-")) and @src ] ' ,
11751175 // .h-x>:only-child:not[.h-*]>object[data]:only-of-type:not[.h-*]
1176- './*[not(contains(concat(" ", @class), " h-")) and count(../*) = 1 and count(object) = 1]/object[not(contains(concat(" ", @class), " h-"))] ' ,
1176+ './*[not(contains(concat(" ", @class), " h-")) and count(../*) = 1 and count(object) = 1]/object[not(contains(concat(" ", @class), " h-")) and @data ] ' ,
11771177 );
11781178
11791179 foreach ($ xpaths as $ path ) {
@@ -1182,9 +1182,9 @@ public function parseImpliedPhoto(\DOMElement $e) {
11821182 if ($ els !== false && $ els ->length === 1 ) {
11831183 $ el = $ els ->item (0 );
11841184 if ($ el ->tagName == 'img ' ) {
1185- return $ el ->getAttribute ('src ' );
1186- } else if ($ el ->tagName == 'object ' && $ el -> hasAttribute ( ' data ' ) ) {
1187- return $ el ->getAttribute ('data ' );
1185+ return $ this -> resolveUrl ( $ el ->getAttribute ('src ' ) );
1186+ } else if ($ el ->tagName == 'object ' ) {
1187+ return $ this -> resolveUrl ( $ el ->getAttribute ('data ' ) );
11881188 }
11891189 }
11901190 }
0 commit comments