From fd785f3d32d0b299556890e9fa639d5cc1209019 Mon Sep 17 00:00:00 2001 From: filip Date: Thu, 7 Jul 2016 23:51:39 +0200 Subject: new function 'get sanitized string from $_GET' --- langs.inc.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'langs.inc.php') diff --git a/langs.inc.php b/langs.inc.php index c578dd2ee..bb412f2b8 100644 --- a/langs.inc.php +++ b/langs.inc.php @@ -138,6 +138,18 @@ function locale_underscore_to_hyphen($locale) } +/** + * Returns sanitized specified $_GET variable by name if it exists and strip tags from it + * + * @param string name of a $_GET vaiable + * + * @return string sanitized string, empty on empty string or on error in filtering +*/ +function get_sane_string($str){ + return (string) filter_input(INPUT_GET, $str, FILTER_SANITIZE_STRING); +} + + /** */ function show_langs($langs) -- cgit v1.2.1