From d0bdb3f2987ddac3c46df6beaa0d4fa72cac959e Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch> Date: Wed, 4 Sep 2024 10:58:00 +0200 Subject: [PATCH] update queryparam class --- public_html/deployment/classes/queryparam.class.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/public_html/deployment/classes/queryparam.class.php b/public_html/deployment/classes/queryparam.class.php index 3379bc5b..fd6b4448 100644 --- a/public_html/deployment/classes/queryparam.class.php +++ b/public_html/deployment/classes/queryparam.class.php @@ -9,6 +9,10 @@ * <VALUE> matches /^[a-z]*$/ * <code>queryparam::get('page', '/^[a-z]*$/');</code> * + * Ideas: + * - add more type validation + * - add regex param with chars to remove eg /[^a-z]/ to keep only lowercase letters + * * Axel <axel.hahn@unibe.ch> * 2024-08-29 Axel php8 only; added variable types; short array syntax */ @@ -82,12 +86,9 @@ class queryparam } // set it to POST or GET variable - $aScope = isset($_POST[$sVarname]) && $_POST[$sVarname] - ? $_POST[$sVarname] - : ((isset($_GET[$sVarname]) && $_GET[$sVarname]) - ? $_GET[$sVarname] - : false - ) + $aScope = isset($_POST[$sVarname]) + ? $_POST + : $_GET ; return self::getvar($aScope, $sVarname, $sRegexMatch, $sType); -- GitLab