mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 13:54:02 -07:00
Refactored Validate class (#646)
* Refactored Validate class * Fixed undefined variables * Moved check for empty
This commit is contained in:
parent
274550cec4
commit
8cbe09027a
6 changed files with 35 additions and 26 deletions
|
@ -26,7 +26,7 @@ $value = $this->request['value'] = (string)(isset($this->request['value'])) ? $t
|
|||
switch ($field) {
|
||||
case 'username':
|
||||
$value = clean_username($value);
|
||||
if ($err = \TorrentPier\Legacy\Validate::username($value)) {
|
||||
if ($err = \TorrentPier\Validate::username($value)) {
|
||||
$this->ajax_die(strip_tags($err));
|
||||
}
|
||||
$this->response['new_value'] = $this->request['value'];
|
||||
|
@ -34,7 +34,7 @@ switch ($field) {
|
|||
|
||||
case 'user_email':
|
||||
$value = htmlCHR($value);
|
||||
if ($err = \TorrentPier\Legacy\Validate::email($value)) {
|
||||
if ($err = \TorrentPier\Validate::email($value)) {
|
||||
$this->ajax_die($err);
|
||||
}
|
||||
$this->response['new_value'] = $this->request['value'];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue