{"record":{"id":"9f856b9edcf18df6","repo":"octobercms/october","slug":"password-must-contain-at-least-one-uppercase-chara","errorCode":null,"errorMessage":"Password must contain at least one uppercase character.","messagePattern":"Password must contain at least one uppercase character\\.","errorType":"validation","errorClass":"ValidationException","httpStatus":422,"severity":"error","filePath":"modules/backend/models/User.php","lineNumber":363,"sourceCode":"        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.')]);\n            }\n        }\n\n        if ($policy['require_nonalpha'] ?? false) {\n            if (!Str::contains($password, str_split(\"!@#$%^&*()_+-=[]{}|'\"))) {\n                throw new ValidationException(['password' => __('Password must contain at least one nonalphanumeric character.')]);","sourceCodeStart":345,"sourceCodeEnd":381,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/backend/models/User.php#L345-L381","documentation":"Error \"Password must contain at least one uppercase character.\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/backend/models/User.php:363 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"}