From: joshuaruesweg Date: Fri, 12 Mar 2021 14:55:18 +0000 (+0100) Subject: Use DOMElement::getAttribute X-Git-Tag: 5.4.0_Alpha_1~146^2~4 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cea9e2dae0a78193a3125608418b30f3c101d680;p=GitHub%2FWoltLab%2FWCF.git Use DOMElement::getAttribute --- diff --git a/wcfsetup/install/files/lib/system/message/unfurl/UnfurlResponse.class.php b/wcfsetup/install/files/lib/system/message/unfurl/UnfurlResponse.class.php index c12ef57c7f..dff908d0c4 100644 --- a/wcfsetup/install/files/lib/system/message/unfurl/UnfurlResponse.class.php +++ b/wcfsetup/install/files/lib/system/message/unfurl/UnfurlResponse.class.php @@ -211,11 +211,8 @@ final class UnfurlResponse // og:title $list = $this->domXPath->query("//meta[@property='og:title']"); foreach ($list as $node) { - foreach ($node->attributes as $attribute) { - if ($attribute->nodeName === 'content') { - return $attribute->nodeValue; - } - } + /** @var \DOMElement $node */ + return $node->getAttribute("content"); } // title tag @@ -237,11 +234,8 @@ final class UnfurlResponse // og:description $list = $this->domXPath->query("//meta[@property='og:description']"); foreach ($list as $node) { - foreach ($node->attributes as $attribute) { - if ($attribute->nodeName === 'content') { - return $attribute->nodeValue; - } - } + /** @var \DOMElement $node */ + return $node->getAttribute("content"); } } @@ -257,11 +251,8 @@ final class UnfurlResponse // og:image $list = $this->domXPath->query("//meta[@property='og:image']"); foreach ($list as $node) { - foreach ($node->attributes as $attribute) { - if ($attribute->nodeName === 'content') { - return $attribute->nodeValue; - } - } + /** @var \DOMElement $node */ + return $node->getAttribute("content"); } }