diff options
Diffstat (limited to '')
| -rw-r--r-- | type/Base.class.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/type/Base.class.php b/type/Base.class.php index c3741bd..e18d27a 100644 --- a/type/Base.class.php +++ b/type/Base.class.php | |||
| @@ -165,6 +165,7 @@ class Type_Base { | |||
| 165 | $this->files = array(); | 165 | $this->files = array(); |
| 166 | $this->identifiers = array(); | 166 | $this->identifiers = array(); |
| 167 | 167 | ||
| 168 | $datadir_prefix = preg_quote($this->datadir, '#'); | ||
| 168 | foreach($files as $filename) { | 169 | foreach($files as $filename) { |
| 169 | $basename=basename($filename,'.rrd'); | 170 | $basename=basename($filename,'.rrd'); |
| 170 | $instance = strpos($basename,'-') | 171 | $instance = strpos($basename,'-') |
| @@ -173,7 +174,9 @@ class Type_Base { | |||
| 173 | 174 | ||
| 174 | $this->tinstances[] = $instance; | 175 | $this->tinstances[] = $instance; |
| 175 | $this->files[$instance] = $filename; | 176 | $this->files[$instance] = $filename; |
| 176 | $this->identifiers[$instance] = preg_replace("#^$this->datadir/(.*)\.rrd$#", '$1', $filename); | 177 | $this->identifiers[$instance] = preg_replace( |
| 178 | "#^{$datadir_prefix}/(.*)\.rrd$#", '$1', | ||
| 179 | $filename); | ||
| 177 | } | 180 | } |
| 178 | 181 | ||
| 179 | sort($this->tinstances); | 182 | sort($this->tinstances); |
