diff options
author | Marc Alexander <admin@m-a-styles.de> | 2015-03-05 16:02:46 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2015-03-05 16:02:46 +0100 |
commit | d0ab101c32c387a424544fae43d8955b8799d713 (patch) | |
tree | adffe03e9df7cc58d045352dd0045f454b8ffe11 /phpBB/phpbb/cache | |
parent | 8f09ff210f0ece0e509b9ea733df91891104f55a (diff) | |
parent | 4618a3e2f83d7967f41bef52a2e996b610febfbb (diff) | |
download | forums-d0ab101c32c387a424544fae43d8955b8799d713.tar forums-d0ab101c32c387a424544fae43d8955b8799d713.tar.gz forums-d0ab101c32c387a424544fae43d8955b8799d713.tar.bz2 forums-d0ab101c32c387a424544fae43d8955b8799d713.tar.xz forums-d0ab101c32c387a424544fae43d8955b8799d713.zip |
Merge pull request #3453 from RMcGirr83/ticket/13477
[ticket/13477] Update file cache driver for extension paths
Diffstat (limited to 'phpBB/phpbb/cache')
-rw-r--r-- | phpBB/phpbb/cache/driver/file.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/phpBB/phpbb/cache/driver/file.php b/phpBB/phpbb/cache/driver/file.php index fd5bce4515..9a7c4aec7f 100644 --- a/phpBB/phpbb/cache/driver/file.php +++ b/phpBB/phpbb/cache/driver/file.php @@ -279,6 +279,7 @@ class file extends \phpbb\cache\driver\base if ($var_name[0] == '_') { global $phpEx; + $var_name = $this->clean_varname($var_name); return file_exists($this->cache_dir . 'data' . $var_name . ".$phpEx"); } else @@ -334,6 +335,7 @@ class file extends \phpbb\cache\driver\base { global $phpEx; + $filename = $this->clean_varname($filename); $file = "{$this->cache_dir}$filename.$phpEx"; $type = substr($filename, 0, strpos($filename, '_')); @@ -516,6 +518,7 @@ class file extends \phpbb\cache\driver\base { global $phpEx; + $filename = $this->clean_varname($filename); $file = "{$this->cache_dir}$filename.$phpEx"; $lock = new \phpbb\lock\flock($file); @@ -584,4 +587,15 @@ class file extends \phpbb\cache\driver\base return $return_value; } + + /** + * Replace slashes in the file name + * + * @param string $varname name of a cache variable + * @return string $varname name that is safe to use as a filename + */ + protected function clean_varname($varname) + { + return str_replace('/', '-', $varname); + } } |