WCF
WCF copied to clipboard
UserOption::getOptionByName(optionname) loads wrong table
The DatabaseObject wcf\data\user\option\UserOption extends wcf\data\option\Option
The Static Method getOptionByName loads all Data from Table ´"wcf"_ . WCF_N . "Option"´.
So this static Method is not usefull in UserOption.
So i Changed the Method to:
public static function getOptionByName($optionName)
{
$sql = "SELECT *
FROM " . self::getDatabaseTableName() . "
WHERE optionName = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$optionName]);
return $statement->fetchObject(self::class);
}