From 16e710fe4e462ef80302014ab4ac6628d412c664 Mon Sep 17 00:00:00 2001 From: Julian Brost Date: Sun, 9 Dec 2018 16:00:31 +0100 Subject: functions.inc.php: escape minus in regex This makes CGP work on PHP 7.3 as it otherwise only shows an "Unknown host" error message and logs the following PHP warning: PHP Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in .../inc/functions.inc.php on line 37 --- inc/functions.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/functions.inc.php b/inc/functions.inc.php index 77cbe4b..376b6e1 100644 --- a/inc/functions.inc.php +++ b/inc/functions.inc.php @@ -34,7 +34,7 @@ function GET($index = NULL, $value = NULL) { case 'h': # host case 'pi': # plugin instance case 'ti': # type instance - if (!preg_match('/^[\w-.: ]+$/u', $value)) { + if (!preg_match('/^[\w\-.: ]+$/u', $value)) { error_log(sprintf('Invalid %s in $_GET["%s"]: "%s"', $desc[$index], $index, $value)); return NULL; } -- cgit v1.1