Fix checks in UserRegistrationDateCondition
authorMatthias Schmidt <gravatronics@live.com>
Tue, 13 May 2014 20:34:27 +0000 (22:34 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 13 May 2014 20:34:27 +0000 (22:34 +0200)
wcfsetup/install/files/lib/system/condition/UserRegistrationDateCondition.class.php

index 37a4e59d79ea3fc3b895de09f47cb23136d0bea1..b0a95eeee7edd49ade0d2debceb77b9020f676a7 100644 (file)
@@ -39,7 +39,7 @@ class UserRegistrationDateCondition extends AbstractSingleFieldCondition impleme
         */
        public function addUserCondition(Condition $condition, UserList $userList) {
                if ($condition->registrationDateEnd !== null) {
-                       $userList->getConditionBuilder()->add('user_table.registrationDate <= ?', array(strtotime($condition->registrationDateEnd) + 24 * 3600 - 1));
+                       $userList->getConditionBuilder()->add('user_table.registrationDate < ?', array(strtotime($condition->registrationDateEnd) + 86400));
                }
                if ($condition->registrationDateStart !== null) {
                        $userList->getConditionBuilder()->add('user_table.registrationDate >= ?', array(strtotime($condition->registrationDateStart)));
@@ -50,10 +50,10 @@ class UserRegistrationDateCondition extends AbstractSingleFieldCondition impleme
         * @see \wcf\system\condition\IUserCondition::checkUser()
         */
        public function checkUser(Condition $condition, User $user) {
-               if ($condition->registrationDateStart !== null && $user->registrationDate < $condition->registrationDateStart) {
+               if ($condition->registrationDateStart !== null && $user->registrationDate < strtotime($condition->registrationDateStart)) {
                        return false;
                }
-               if ($condition->registrationDateEnd !== null && $user->registrationDate > $condition->registrationDateEnd) {
+               if ($condition->registrationDateEnd !== null && $user->registrationDate >= strtotime($condition->registrationDateEnd) + 86400) {
                        return false;
                }