From 596dd7d41468ab8ffb3b821163b486e6629e2212 Mon Sep 17 00:00:00 2001 From: Jakob Haufe Date: Tue, 9 Feb 2010 18:33:27 +0100 Subject: make rrdfiles using utf8 and spaces work --- inc/functions.inc.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'inc') diff --git a/inc/functions.inc.php b/inc/functions.inc.php index 2906530..b0706d5 100644 --- a/inc/functions.inc.php +++ b/inc/functions.inc.php @@ -5,17 +5,17 @@ function validate_get($value, $type) { switch($type) { case 'host': - if (!preg_match('/^[\d\w\W]+$/', $value)) + if (!preg_match('/^[\d\w\W]+$/u', $value)) return NULL; break; case 'plugin': case 'type': - if (!preg_match('/^\w+$/', $value)) + if (!preg_match('/^\w+$/u', $value)) return NULL; break; case 'pinstance': case 'tinstance': - if (!preg_match('/^[\d\w-]+$/', $value)) + if (!preg_match('/^[\d\w-]+$/u', $value)) return NULL; break; } @@ -23,5 +23,8 @@ function validate_get($value, $type) { return $value; } +function crc32hex($str) { + return sprintf("%x",crc32($str)); +} ?> -- cgit v1.1