{"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":"Error \"Password must have a minimum of length of :min characters\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/backend/models/User.php:357 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}