Skip to content
Snippets Groups Projects
Commit d0bdb3f2 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

update queryparam class

parent 5f327945
Branches
No related tags found
1 merge request!66php8 only; added variable types; short array syntax; remove glyphicons
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment