{"record":{"id":"11ac48b9f6d01ece","repo":"octobercms/october","slug":"password-must-contain-at-least-one-nonalphanumeric","errorCode":null,"errorMessage":"Password must contain at least one nonalphanumeric character.","messagePattern":"Password must contain at least one nonalphanumeric character\\.","errorType":"validation","errorClass":"ValidationException","httpStatus":422,"severity":"error","filePath":"modules/backend/models/User.php","lineNumber":381,"sourceCode":"                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.')]);\n            }\n        }\n\n        /**\n         * @event user.validatePasswordPolicy\n         * Called when the user password is validated against the policy\n         *\n         * Example usage:\n         *\n         *     $model->bindEvent('user.validatePasswordPolicy', function (string $password) use ($model) {\n         *         throw new ValidationException(['password' => 'Prevent anything from validating ever!']);\n         *     });\n         *\n         */\n        $this->fireEvent('user.validatePasswordPolicy', compact('password'));\n    }\n}\n","sourceCodeStart":363,"sourceCodeEnd":399,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/backend/models/User.php#L363-L399","documentation":"Validation failure in User::validatePasswordPolicy when require_nonalphanumeric is enabled and the password contains no symbol characters (the ctype-alnum filter over all characters fails). Special-character-presence guard over the policy config.","triggerScenarios":"Thrown at modules/backend/models/User.php:381 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Include at least one non-alphanumeric character (symbol) in the password","Disable require_nonalphanumeric in backend.password_policy if the policy is unwanted","Show live policy hints in the password form to prevent submission failures"],"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"}