blob: 37350295b2c406e9df8c7f5e4aa11b4c487ff3c4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
<?php
include_once './includes/form/Form.php';
class SignInForm extends Form
{
public function validate_username($username): ?string
{
$result = null;
if (empty($username)) {
$this->report_error('Please provide a username.');
} else {
$result = filter_var($username, FILTER_SANITIZE_STRING);
}
return $result;
}
public function validate_password($password): ?string
{
$result = null;
if (empty($password)) {
$this->report_error('Please provide a password.');
} else {
$result = filter_var($password, FILTER_SANITIZE_STRING);
}
return $result;
}
}
|