public static function checkPasswordResetValidity() { if ($_POST['password'] != $_POST['password_again']) { $popups[] = array('type' => 'danger', 'content' => 'Hesla se neshodují.'); } if (preg_match('/[^a-zA-Z0-9]/', $_POST['password'])) { $popups[] = array('type' => 'danger', 'content' => 'Vaše heslo obsahuje nepovolené znaky nebo mezeru.'); } if (strlen(utf8_decode($_POST["password"])) < 8) { $popups[] = array('type' => 'danger', 'content' => 'Vaše heslo je příliš krátké.'); } if (strlen(utf8_decode($_POST["password"])) > 32) { $popups[] = array('type' => 'danger', 'content' => 'Vaše heslo je příliš dlouhé.'); } if (isset($popups)) { foreach ($popups as $p) { Controller::addPopup($p["type"], $p["content"]); } return false; } return true; }