summaryrefslogtreecommitdiffstats
path: root/lib/cache
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-06-18 11:33:24 +0200
committerBart Visscher <bartv@thisnet.nl>2012-06-18 11:33:24 +0200
commit977cd0df6b502c1a15147c1641fea754128a0875 (patch)
tree25f1949eb75a6ce7fec35b77327f91843f7e4464 /lib/cache
parenta5a1a9fd4a2f1cd5f2457ba3ab0ceb432da1be33 (diff)
downloadnextcloud-server-977cd0df6b502c1a15147c1641fea754128a0875.tar.gz
nextcloud-server-977cd0df6b502c1a15147c1641fea754128a0875.zip
Fix errors for minimizer
Diffstat (limited to 'lib/cache')
-rw-r--r--lib/cache/fileglobal.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/cache/fileglobal.php b/lib/cache/fileglobal.php
index 469dd4b6dd4..1c2c9bdc82d 100644
--- a/lib/cache/fileglobal.php
+++ b/lib/cache/fileglobal.php
@@ -16,7 +16,12 @@ class OC_Cache_FileGlobal{
return $cache_dir;
}
+ protected function fixKey($key) {
+ return str_replace('/', '_', $key);
+ }
+
public function get($key) {
+ $key = $this->fixKey($key);
if ($this->hasKey($key)) {
$cache_dir = $this->getCacheDir();
return file_get_contents($cache_dir.$key);
@@ -25,6 +30,7 @@ class OC_Cache_FileGlobal{
}
public function set($key, $value, $ttl=0) {
+ $key = $this->fixKey($key);
$cache_dir = $this->getCacheDir();
if ($cache_dir and file_put_contents($cache_dir.$key, $value)) {
if ($ttl === 0) {
@@ -36,6 +42,7 @@ class OC_Cache_FileGlobal{
}
public function hasKey($key) {
+ $key = $this->fixKey($key);
$cache_dir = $this->getCacheDir();
if ($cache_dir && is_file($cache_dir.$key)) {
$mtime = filemtime($cache_dir.$key);
@@ -53,6 +60,7 @@ class OC_Cache_FileGlobal{
if(!$cache_dir){
return false;
}
+ $key = $this->fixKey($key);
return unlink($cache_dir.$key);
}