{"record":{"id":"04c41008a45c6cfc","repo":"octobercms/october","slug":"password-must-have-a-minimum-of-length-of-min-cha","errorCode":null,"errorMessage":"Password must have a minimum of length of :min characters","messagePattern":"Password must have a minimum of length of :min characters","errorType":"validation","errorClass":"ValidationException","httpStatus":422,"severity":"error","filePath":"modules/backend/models/User.php","lineNumber":357,"sourceCode":"            return false;\n        }\n\n        $changedDays = (int) $this->freshTimestamp()\n            ->diffInDays($this->password_changed_at ?: $this->created_at);\n\n        return $changedDays > $expireDays;\n    }\n\n    /**\n     * validatePasswordPolicy will check the password based on the backend policy\n     */\n    public function validatePasswordPolicy($password)\n    {\n        $policy = Config::get('backend.password_policy', []);\n\n        if ($minLength = $policy['min_length'] ?? 4) {\n            if (mb_strlen($password) < $minLength) {\n                throw new ValidationException(['password' => __('Password must have a minimum of length of :min characters', ['min'=>$minLength])]);\n            }\n        }\n\n        if ($policy['require_uppercase'] ?? false) {\n            if (mb_strtolower($password) === $password) {\n                throw new ValidationException(['password' => __('Password must contain at least one uppercase character.')]);\n            }\n        }\n\n        if ($policy['require_lowercase'] ?? false) {\n            if (mb_strtoupper($password) === $password) {\n                throw new ValidationException(['password' => __('Password must contain at least one lowercase character.')]);\n            }\n        }\n\n        if ($policy['require_number'] ?? false) {\n            if (!array_filter(str_split($password), 'is_numeric')) {\n                throw new ValidationException(['password' => __('Password must contain at least one number.')]);","sourceCodeStart":339,"sourceCodeEnd":375,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/backend/models/User.php#L339-L375","documentation":"Validation failure in User::validatePasswordPolicy: the configured backend.password_policy min_length (default 4) exceeds the length of the supplied password. This is a policy guard applied during password set/reset, parameterized with the configured minimum.","triggerScenarios":"Thrown at modules/backend/models/User.php:357 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose a password at least min_length characters long as stated in the message","Adjust the min_length value in the backend.password_policy config if the policy is too strict for your users","Surface the requirement in the front-end form so users know the minimum"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","contentChangedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}