fix validInt to take negative integers. Introduce validCardinal to handle positive integers
This commit is contained in:
parent
65418abf98
commit
33a067c085
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue