From: Alexander Ebert Date: Sun, 13 Jan 2013 16:43:56 +0000 (+0100) Subject: Fixed readBoolean(), previously readBool() X-Git-Tag: 2.0.0_Beta_1~570 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=976d79e307cc2bfa275f1ff985871c31575de064;p=GitHub%2FWoltLab%2FWCF.git Fixed readBoolean(), previously readBool() --- diff --git a/wcfsetup/install/files/lib/data/AbstractDatabaseObjectAction.class.php b/wcfsetup/install/files/lib/data/AbstractDatabaseObjectAction.class.php index 39c2464232..453bc025b1 100644 --- a/wcfsetup/install/files/lib/data/AbstractDatabaseObjectAction.class.php +++ b/wcfsetup/install/files/lib/data/AbstractDatabaseObjectAction.class.php @@ -89,7 +89,7 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction, ID const TYPE_INTEGER = 1; const TYPE_STRING = 2; - const TYPE_BOOL = 3; + const TYPE_BOOLEAN = 3; /** * Initialize a new DatabaseObject-related action. @@ -404,8 +404,8 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction, ID * @param boolean $allowEmpty * @param string $arrayIndex */ - protected function readBool($variableName, $allowEmpty = false, $arrayIndex = '') { - $this->readValue($variableName, $allowEmpty, $arrayIndex, self::TYPE_BOOL); + protected function readBoolean($variableName, $allowEmpty = false, $arrayIndex = '') { + $this->readValue($variableName, $allowEmpty, $arrayIndex, self::TYPE_BOOLEAN); } /** @@ -465,7 +465,7 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction, ID } break; - case self::TYPE_BOOL: + case self::TYPE_BOOLEAN: if (!isset($target[$variableName])) { if ($allowEmpty) { $target[$variableName] = false; @@ -475,11 +475,11 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction, ID } } else { - if (is_string($target[$variableName])) { - $target[$variableName] = $target[$variableName] != 'false'; + if (is_numeric($target[$variableName])) { + $target[$variableName] = (bool) $target[$variableName]; } else { - $target[$variableName] = (bool) $target[$variableName]; + $target[$variableName] = $target[$variableName] != 'false'; } } break;