fix validInt to take negative integers. Introduce validCardinal to handle positive integers

This commit is contained in:
Isaac Connor 2021-10-05 17:43:48 -04:00
parent 75a014321e
commit c72d34f176
1 changed files with 4 additions and 0 deletions

View File

@ -1990,6 +1990,10 @@ function requestVar($name, $default='') {
// For numbers etc in javascript or tags etc
function validInt($input) {
return preg_replace('/[^\-\d]/', '', $input);
}
function validCardinal($input) {
return preg_replace('/\D/', '', $input);
}