From 4a0817a61b8dff27e7974e1d4cc9a1e7b8500146 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 22 Jun 2015 19:28:17 +0200 Subject: [PATCH] Fix instanceof checks --- .../AbstractObjectTextPropertyCondition.class.php | 7 ++++--- .../system/condition/AbstractTimestampCondition.class.php | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/wcfsetup/install/files/lib/system/condition/AbstractObjectTextPropertyCondition.class.php b/wcfsetup/install/files/lib/system/condition/AbstractObjectTextPropertyCondition.class.php index d5e1088033..585b7a6785 100644 --- a/wcfsetup/install/files/lib/system/condition/AbstractObjectTextPropertyCondition.class.php +++ b/wcfsetup/install/files/lib/system/condition/AbstractObjectTextPropertyCondition.class.php @@ -2,7 +2,6 @@ namespace wcf\system\condition; use wcf\data\DatabaseObject; use wcf\data\DatabaseObjectList; -use wcf\util\ClassUtil; /** * Abstract condition implementation for check a text-typed property of a database @@ -39,7 +38,8 @@ abstract class AbstractObjectTextPropertyCondition extends AbstractTextCondition * @see \wcf\system\condition\IObjectListCondition::addObjectListCondition() */ public function addObjectListCondition(DatabaseObjectList $objectList, array $conditionData) { - if (!ClassUtil::isInstanceOf($objectList, $this->getListClassName())) return; + $className = $this->getListClassName(); + if (!($objectList instanceof $className)) return; if ($this->supportsMultipleValues) { $objectList->getConditionBuilder()->add($objectList->getDatabaseTableAlias().'.'.$this->getPropertyName().' IN (?)', [ $conditionData[$this->fieldName] ]); @@ -53,7 +53,8 @@ abstract class AbstractObjectTextPropertyCondition extends AbstractTextCondition * @see \wcf\system\condition\IObjectCondition::checkObject() */ public function checkObject(DatabaseObject $object, array $conditionData) { - if (!ClassUtil::isInstanceOf($object, $this->getClassName())) return; + $className = $this->getClassName(); + if (!($object instanceof $className)) return; return in_array($object->{$this->getPropertyName()}, $conditionData[$this->fieldName]); } diff --git a/wcfsetup/install/files/lib/system/condition/AbstractTimestampCondition.class.php b/wcfsetup/install/files/lib/system/condition/AbstractTimestampCondition.class.php index 7972e5448c..9008bc4ab6 100644 --- a/wcfsetup/install/files/lib/system/condition/AbstractTimestampCondition.class.php +++ b/wcfsetup/install/files/lib/system/condition/AbstractTimestampCondition.class.php @@ -7,7 +7,6 @@ use wcf\data\DatabaseObject; use wcf\data\DatabaseObjectList; use wcf\system\exception\UserInputException; use wcf\system\WCF; -use wcf\util\ClassUtil; /** * Condition implementation for compairing a user-bound timestamp with a fixed time @@ -49,7 +48,8 @@ abstract class AbstractTimestampCondition extends AbstractSingleFieldCondition i * @see \wcf\system\condition\IObjectListCondition::addObjectListCondition() */ public function addObjectListCondition(DatabaseObjectList $objectList, array $conditionData) { - if (!ClassUtil::isInstanceOf($objectList, $this->getListClassName())) return; + $className = $this->getListClassName(); + if (!($objectList instanceof $className)) return; $objectList->getConditionBuilder()->add($objectList->getDatabaseTableAlias().'.'.$this->getPropertyName().' <> ?', [ 0 ]); if (isset($conditionData['endTime'])) { @@ -64,7 +64,8 @@ abstract class AbstractTimestampCondition extends AbstractSingleFieldCondition i * @see \wcf\system\condition\IObjectCondition::checkObject() */ public function checkObject(DatabaseObject $object, array $conditionData) { - if (!ClassUtil::isInstanceOf($object, $this->getClassName())) return; + $className = $this->getClassName(); + if (!($object instanceof $className)) return; if (isset($conditionData['startTime']) && $object->{$this->getPropertyName()} < strtotime($conditionData['startTime'])) { return false; -- 2.20.1