diff --git a/datamodels/2.x/authent-local/model.authent-local.php b/datamodels/2.x/authent-local/model.authent-local.php index a2ae3c93e..e6a52ae9a 100755 --- a/datamodels/2.x/authent-local/model.authent-local.php +++ b/datamodels/2.x/authent-local/model.authent-local.php @@ -157,7 +157,7 @@ class UserLocal extends UserInternal public function IsPasswordValid() { - return (isset($this->m_oPasswordValidity)) && ($this->m_oPasswordValidity->isPasswordValid()); + return (empty($this->m_oPasswordValidity)) || ($this->m_oPasswordValidity->isPasswordValid()); } /** diff --git a/test/coreExtensions/UserLocalTest.php b/test/coreExtensions/UserLocalTest.php index 2f06fdb7b..f55505ba7 100644 --- a/test/coreExtensions/UserLocalTest.php +++ b/test/coreExtensions/UserLocalTest.php @@ -73,6 +73,13 @@ class UserLocalTest extends ItopTestCase 'password' => 'foo', 'expectedCheckStatus' => false, ), + 'noPattern' => array( + 'valueMap' => array( + array('authent-local', 'password_validation.pattern', null, '') + ), + 'password' => 'foo', + 'expectedCheckStatus' => true, + ), 'validClass' => array( 'valueMap' => array( array(