From: Matthias Schmidt Date: Sun, 7 Aug 2016 11:45:57 +0000 (+0200) Subject: Use PreparedStatement::fetchObject() in Tag::getTag() X-Git-Tag: 3.0.0_Beta_1~797 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2a1449aa802d6c64069156321f07baf9f0f50c62;p=GitHub%2FWoltLab%2FWCF.git Use PreparedStatement::fetchObject() in Tag::getTag() --- diff --git a/wcfsetup/install/files/lib/data/tag/Tag.class.php b/wcfsetup/install/files/lib/data/tag/Tag.class.php index 9cc4ad169f..f580b9b0bc 100644 --- a/wcfsetup/install/files/lib/data/tag/Tag.class.php +++ b/wcfsetup/install/files/lib/data/tag/Tag.class.php @@ -24,7 +24,7 @@ class Tag extends DatabaseObject implements IRouteController { * * @param string $name * @param integer $languageID - * @return mixed + * @return Tag|null */ public static function getTag($name, $languageID = 0) { $sql = "SELECT * @@ -33,10 +33,8 @@ class Tag extends DatabaseObject implements IRouteController { AND name = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([$languageID, $name]); - $row = $statement->fetchArray(); - if ($row !== false) return new Tag(null, $row); - return null; + return $statement->fetchObject(Tag::class); } /**