aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJulian Brost2018-12-09 16:00:31 +0100
committerJulian Brost2018-12-09 16:00:31 +0100
commit16e710fe4e462ef80302014ab4ac6628d412c664 (patch)
treed9c5c8bc49fb09baca87389735f2541c654dfe15
parentMerge pull request #162 from Self-Perfection/patch-1 (diff)
downloadapt-panopticon_cgp-16e710fe4e462ef80302014ab4ac6628d412c664.zip
apt-panopticon_cgp-16e710fe4e462ef80302014ab4ac6628d412c664.tar.gz
apt-panopticon_cgp-16e710fe4e462ef80302014ab4ac6628d412c664.tar.bz2
apt-panopticon_cgp-16e710fe4e462ef80302014ab4ac6628d412c664.tar.xz
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
-rw-r--r--inc/functions.inc.php2
1 files changed, 1 insertions, 1 deletions
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) {
34 case 'h': # host 34 case 'h': # host
35 case 'pi': # plugin instance 35 case 'pi': # plugin instance
36 case 'ti': # type instance 36 case 'ti': # type instance
37 if (!preg_match('/^[\w-.: ]+$/u', $value)) { 37 if (!preg_match('/^[\w\-.: ]+$/u', $value)) {
38 error_log(sprintf('Invalid %s in $_GET["%s"]: "%s"', $desc[$index], $index, $value)); 38 error_log(sprintf('Invalid %s in $_GET["%s"]: "%s"', $desc[$index], $index, $value));
39 return NULL; 39 return NULL;
40 } 40 }