Check for quotes and backslash in password.
This commit is contained in:
1 parent
73a3ee2831
commit
19f76fbd9c
3 files changed
+17
No files matched your search
@@ -56,6 +56,7 @@ class User {
|
||||
$this->id = -1;
|
||||
return false;
|
||||
} else {
|
||||
/* Validate user supplied data. */
|
||||
if (strlen(stripcslashes($data['username'])) < 3 || strlen(stripcslashes($data['username'])) > 12 ) {
|
||||
notify("Brukernavnet må være mellom 3 og 12 tegn.");
|
||||
$this->id = -1;
|
||||
@@ -72,6 +73,12 @@ class User {
|
||||
$this->id = -1;
|
||||
return false;
|
||||
}
|
||||
/* No double nor single quotes */
|
||||
if(preg_match('/["\'\\]+/', $data['password1'])) {
|
||||
notify("Passordet kan ikke inneholde enkel- eller dobbelfnutt eller bakslask.");
|
||||
$this->id = -1;
|
||||
return false;
|
||||
}
|
||||
if ($data['password1'] != $data['password2']) {
|
||||
notify("Passordene var ikke like.");
|
||||
$this->id = -1;
|
||||
|
||||
Reference in new issue
Block a user