From c72d34f17605644fbe768a0938667c736f4d46c1 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 5 Oct 2021 17:43:48 -0400 Subject: [PATCH] fix validInt to take negative integers. Introduce validCardinal to handle positive integers --- web/includes/functions.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/includes/functions.php b/web/includes/functions.php index 60fb99571..89d2cc8ad 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -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); }