diff --git a/lib/datasources/WeatherMapDataSource_rrd.php b/lib/datasources/WeatherMapDataSource_rrd.php index 40128fc..79e512c 100644 --- a/lib/datasources/WeatherMapDataSource_rrd.php +++ b/lib/datasources/WeatherMapDataSource_rrd.php @@ -67,7 +67,8 @@ function wmrrd_read_from_real_rrdtool_aggregate($rrdfile,$cf,$aggregatefn,$start // rrdcached Support: strip "./" from Data Source if ($map->daemon) { - $rrdfile = trim($rrdfile,"^./"); + if (substr($rrdfile, 0, 2) == "./") + $rrdfile = substr($rrdfile, 2); } // Assemble an array of command args. @@ -209,7 +210,8 @@ function wmrrd_read_from_real_rrdtool($rrdfile,$cf,$start,$end,$dsnames, &$data, // rrdcached Support: strip "./" from Data Source if ($map->daemon) { - $rrdfile = trim($rrdfile,"^./"); + if (substr($rrdfile, 0, 2) == "./") + $rrdfile = substr($rrdfile, 2); } $args[] = "fetch";