diff options
author | RMcGirr83 <rmcgirr83@gmail.com> | 2015-02-27 10:48:11 -0500 |
---|---|---|
committer | RMcGirr83 <rmcgirr83@gmail.com> | 2015-03-03 09:31:30 -0500 |
commit | 5cd4941c55d543ecae0a4fdc2fe165921d1dca1b (patch) | |
tree | 9581d9a8771123b056160636d8e668891b3d43bb /phpBB/phpbb/cache/driver | |
parent | 3ac583271f9d2557a1a89ab90e40f9baf6ed8b6d (diff) | |
download | forums-5cd4941c55d543ecae0a4fdc2fe165921d1dca1b.tar forums-5cd4941c55d543ecae0a4fdc2fe165921d1dca1b.tar.gz forums-5cd4941c55d543ecae0a4fdc2fe165921d1dca1b.tar.bz2 forums-5cd4941c55d543ecae0a4fdc2fe165921d1dca1b.tar.xz forums-5cd4941c55d543ecae0a4fdc2fe165921d1dca1b.zip |
[ticket/13477] Update file cache driver for filenames
Replace slashes on file name
PHPBB3-13477
Diffstat (limited to 'phpBB/phpbb/cache/driver')
-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..bc8da19401 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->replace_slashes($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->replace_slashes($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->replace_slashes($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 $name filename + * @return string the corrected name + */ + function replace_slashes($name) + { + return str_replace('/', '-', $name); + } } |