aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/cache/driver
diff options
context:
space:
mode:
authorRMcGirr83 <rmcgirr83@gmail.com>2015-02-27 10:48:11 -0500
committerRMcGirr83 <rmcgirr83@gmail.com>2015-03-03 09:31:30 -0500
commit5cd4941c55d543ecae0a4fdc2fe165921d1dca1b (patch)
tree9581d9a8771123b056160636d8e668891b3d43bb /phpBB/phpbb/cache/driver
parent3ac583271f9d2557a1a89ab90e40f9baf6ed8b6d (diff)
downloadforums-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.php14
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);
+ }
}