Merge pull request #1267 from shreesh-webkul/gli-2355

Added: Validations for backoffice list filters for text fields
This commit is contained in:
Rohit Jain
2024-10-04 17:12:31 +05:30
committed by GitHub

View File

@@ -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']);
}
}
}
}
}
}
}