Skip to content
This repository was archived by the owner on Mar 29, 2022. It is now read-only.
This repository was archived by the owner on Mar 29, 2022. It is now read-only.

Require a complex password. #2

@leebaird

Description

@leebaird
    if(strlen($_POST['password']) < 12) {
        die("Your password is too short. The minimum length is 12 characters.");
    }

    if(!preg_match("#[A-Z]+#", ($_POST['password']))) {
        die("Your password must contain at least one uppercase letter.");
    }

    if(!preg_match("#[a-z]+#", ($_POST['password']))) {
        die("Your password must contain at least one lowercase letter.");
    }

    if(!preg_match("#[0-9]+#", ($_POST['password']))) {
        die("Your password must contain at least one number.");
    }

    if(!preg_match("#[\W]+#", ($_POST['password']))) {
        die("Your password must contain at least one special character.");
    }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions