mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-24 12:03:21 +01:00
[ticket/13477] Update file cache driver for filenames
Replace slashes on file name PHPBB3-13477
This commit is contained in:
parent
3ac583271f
commit
5cd4941c55
14
phpBB/phpbb/cache/driver/file.php
vendored
14
phpBB/phpbb/cache/driver/file.php
vendored
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user