Merge pull request #1267 from shreesh-webkul/gli-2355
Added: Validations for backoffice list filters for text fields
This commit is contained in:
@@ -931,6 +931,18 @@ class AdminControllerCore extends Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (isset($value) && ($value !== '' || !$value === 0)) {
|
||||
if (preg_match('/¤|\|/', $value)) {
|
||||
$this->errors[] = sprintf(Tools::displayError('The %s field is invalid'), $field['title']);
|
||||
} else {
|
||||
if (isset($field['validation']) && $field['validation'] && method_exists('Validate', $field['validation'])) {
|
||||
if (!Validate::{$field['validation']}($value)) {
|
||||
$this->errors[] = sprintf(Tools::displayError('The %s field is invalid'), $field['title']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user