@@ -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,11 +611,11 @@ 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 ' );
618- } elseif ($ u ->tagName == 'object ' and $ u ->getAttribute ('data ' ) !== null ) {
618+ } elseif ($ u ->tagName == 'object ' and $ u ->hasAttribute ('data ' )) {
619619 $ uValue = $ u ->getAttribute ('data ' );
620620 }
621621
@@ -627,9 +627,9 @@ public function parseU(\DOMElement $u) {
627627
628628 if ($ classTitle !== null ) {
629629 return $ classTitle ;
630- } elseif ($ u ->tagName == 'abbr ' and $ u ->getAttribute ('title ' ) !== null ) {
630+ } elseif ($ u ->tagName == 'abbr ' and $ u ->hasAttribute ('title ' )) {
631631 return $ u ->getAttribute ('title ' );
632- } elseif (in_array ($ u ->tagName , array ('data ' , 'input ' )) and $ u ->getAttribute ('value ' ) !== null ) {
632+ } elseif (in_array ($ u ->tagName , array ('data ' , 'input ' )) and $ u ->hasAttribute ('value ' )) {
633633 return $ u ->getAttribute ('value ' );
634634 } else {
635635 return unicodeTrim ($ this ->textContent ($ u ));
@@ -1128,7 +1128,7 @@ public function parseImpliedPhoto(\DOMElement $e) {
11281128
11291129 if ($ el ->tagName == 'img ' ) {
11301130 return $ el ->getAttribute ('src ' );
1131- } else if ($ el ->tagName == 'object ' && $ el ->getAttribute ('data ' ) != '' ) {
1131+ } else if ($ el ->tagName == 'object ' && $ el ->hasAttribute ('data ' )) {
11321132 return $ el ->getAttribute ('data ' );
11331133 }
11341134
0 commit comments