From ca4871ced7147ac8d0ed06aa60c7ccc947932fbc Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Thu, 29 Apr 2010 00:44:54 +0000 Subject: [PATCH] remove parenthesis from safe filenames filter (parenthesis are certified unsafe by the WHO and should be eradicated where possible.) boob /\\ quake //\ ??? // ||_ _|| \\ __||_( `. ,' )_||___ |______\____X____/______;| git-svn-id: http://www.observium.org/svn/observer/trunk@1081 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/graphs/temperature.inc.php | 1 + includes/common.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/html/includes/graphs/temperature.inc.php b/html/includes/graphs/temperature.inc.php index f59d2049c..935349573 100644 --- a/html/includes/graphs/temperature.inc.php +++ b/html/includes/graphs/temperature.inc.php @@ -16,6 +16,7 @@ include("common.inc.php"); $rrd_filename = $config['rrd_dir'] . "/".$hostname."/" . safename("temp-" . $temperature['temp_descr'] . ".rrd"); + $rrd_options .= " DEF:temp=$rrd_filename:temp:AVERAGE"; $rrd_options .= " DEF:temp_max=$rrd_filename:temp:MAX"; $rrd_options .= " DEF:temp_min=$rrd_filename:temp:MIN"; diff --git a/includes/common.php b/includes/common.php index 5e7b700d4..50db46ac7 100644 --- a/includes/common.php +++ b/includes/common.php @@ -89,7 +89,8 @@ function gethostosbyid($id) { function safename($name) { - return preg_replace('/[^a-zA-Z0-9,._\+\(\)\-]/', '_', $name); + return preg_replace('/[^a-zA-Z0-9,._\-]/', '_', $name); + }