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 65418abf98
commit 33a067c085
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 // For numbers etc in javascript or tags etc
function validInt($input) { function validInt($input) {
return preg_replace('/[^\-\d]/', '', $input);
}
function validCardinal($input) {
return preg_replace('/\D/', '', $input); return preg_replace('/\D/', '', $input);
} }