@@ -588,13 +588,13 @@ public function parseP(\DOMElement $p) {
588588
589589 $ this ->resolveChildUrls ($ p );
590590
591- if ($ p ->tagName == 'img ' and $ p ->getAttribute ('alt ' ) !== '' ) {
591+ if ($ p ->tagName == 'img ' and $ p ->hasAttribute ('alt ' )) {
592592 $ pValue = $ p ->getAttribute ('alt ' );
593- } elseif ($ p ->tagName == 'area ' and $ p ->getAttribute ('alt ' ) !== '' ) {
593+ } elseif ($ p ->tagName == 'area ' and $ p ->hasAttribute ('alt ' )) {
594594 $ pValue = $ p ->getAttribute ('alt ' );
595- } elseif ($ p ->tagName == 'abbr ' and $ p ->getAttribute ('title ' ) !== '' ) {
595+ } elseif ($ p ->tagName == 'abbr ' and $ p ->hasAttribute ('title ' )) {
596596 $ pValue = $ p ->getAttribute ('title ' );
597- } elseif (in_array ($ p ->tagName , array ('data ' , 'input ' )) and $ p ->getAttribute ('value ' ) !== '' ) {
597+ } elseif (in_array ($ p ->tagName , array ('data ' , 'input ' )) and $ p ->hasAttribute ('value ' )) {
598598 $ pValue = $ p ->getAttribute ('value ' );
599599 } else {
600600 $ pValue = unicodeTrim ($ this ->innerText ($ p ));
@@ -611,13 +611,13 @@ public function parseP(\DOMElement $p) {
611611 * @todo make this adhere to value-class
612612 */
613613 public function parseU (\DOMElement $ u ) {
614- if (($ u ->tagName == 'a ' or $ u ->tagName == 'area ' ) and $ u ->getAttribute ('href ' ) !== null ) {
614+ if (($ u ->tagName == 'a ' or $ u ->tagName == 'area ' ) and $ u ->hasAttribute ('href ' )) {
615615 $ uValue = $ u ->getAttribute ('href ' );
616- } elseif (in_array ($ u ->tagName , array ('img ' , 'audio ' , 'video ' , 'source ' )) and $ u ->getAttribute ('src ' ) !== null ) {
616+ } elseif (in_array ($ u ->tagName , array ('img ' , 'audio ' , 'video ' , 'source ' )) and $ u ->hasAttribute ('src ' )) {
617617 $ uValue = $ u ->getAttribute ('src ' );
618618 } elseif ($ u ->tagName == 'video ' and !$ u ->hasAttribute ('src ' ) and $ u ->hasAttribute ('poster ' )) {
619619 $ uValue = $ u ->getAttribute ('poster ' );
620- } elseif ($ u ->tagName == 'object ' and $ u ->getAttribute ('data ' ) !== null ) {
620+ } elseif ($ u ->tagName == 'object ' and $ u ->hasAttribute ('data ' )) {
621621 $ uValue = $ u ->getAttribute ('data ' );
622622 }
623623
@@ -629,9 +629,9 @@ public function parseU(\DOMElement $u) {
629629
630630 if ($ classTitle !== null ) {
631631 return $ classTitle ;
632- } elseif ($ u ->tagName == 'abbr ' and $ u ->getAttribute ('title ' ) !== null ) {
632+ } elseif ($ u ->tagName == 'abbr ' and $ u ->hasAttribute ('title ' )) {
633633 return $ u ->getAttribute ('title ' );
634- } elseif (in_array ($ u ->tagName , array ('data ' , 'input ' )) and $ u ->getAttribute ('value ' ) !== null ) {
634+ } elseif (in_array ($ u ->tagName , array ('data ' , 'input ' )) and $ u ->hasAttribute ('value ' )) {
635635 return $ u ->getAttribute ('value ' );
636636 } else {
637637 return unicodeTrim ($ this ->textContent ($ u ));
@@ -1130,7 +1130,7 @@ public function parseImpliedPhoto(\DOMElement $e) {
11301130
11311131 if ($ el ->tagName == 'img ' ) {
11321132 return $ el ->getAttribute ('src ' );
1133- } else if ($ el ->tagName == 'object ' && $ el ->getAttribute ('data ' ) != '' ) {
1133+ } else if ($ el ->tagName == 'object ' && $ el ->hasAttribute ('data ' )) {
11341134 return $ el ->getAttribute ('data ' );
11351135 }
11361136
0 commit comments