mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
[ticket/13477] rename function and fix doc blocks
PHPBB3-13477
This commit is contained in:
parent
5cd4941c55
commit
4618a3e2f8
1 changed files with 7 additions and 7 deletions
14
phpBB/phpbb/cache/driver/file.php
vendored
14
phpBB/phpbb/cache/driver/file.php
vendored
|
@ -279,7 +279,7 @@ class file extends \phpbb\cache\driver\base
|
||||||
if ($var_name[0] == '_')
|
if ($var_name[0] == '_')
|
||||||
{
|
{
|
||||||
global $phpEx;
|
global $phpEx;
|
||||||
$var_name = $this->replace_slashes($var_name);
|
$var_name = $this->clean_varname($var_name);
|
||||||
return file_exists($this->cache_dir . 'data' . $var_name . ".$phpEx");
|
return file_exists($this->cache_dir . 'data' . $var_name . ".$phpEx");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -335,7 +335,7 @@ class file extends \phpbb\cache\driver\base
|
||||||
{
|
{
|
||||||
global $phpEx;
|
global $phpEx;
|
||||||
|
|
||||||
$filename = $this->replace_slashes($filename);
|
$filename = $this->clean_varname($filename);
|
||||||
$file = "{$this->cache_dir}$filename.$phpEx";
|
$file = "{$this->cache_dir}$filename.$phpEx";
|
||||||
|
|
||||||
$type = substr($filename, 0, strpos($filename, '_'));
|
$type = substr($filename, 0, strpos($filename, '_'));
|
||||||
|
@ -518,7 +518,7 @@ class file extends \phpbb\cache\driver\base
|
||||||
{
|
{
|
||||||
global $phpEx;
|
global $phpEx;
|
||||||
|
|
||||||
$filename = $this->replace_slashes($filename);
|
$filename = $this->clean_varname($filename);
|
||||||
$file = "{$this->cache_dir}$filename.$phpEx";
|
$file = "{$this->cache_dir}$filename.$phpEx";
|
||||||
|
|
||||||
$lock = new \phpbb\lock\flock($file);
|
$lock = new \phpbb\lock\flock($file);
|
||||||
|
@ -591,11 +591,11 @@ class file extends \phpbb\cache\driver\base
|
||||||
/**
|
/**
|
||||||
* Replace slashes in the file name
|
* Replace slashes in the file name
|
||||||
*
|
*
|
||||||
* @param string $name filename
|
* @param string $varname name of a cache variable
|
||||||
* @return string the corrected name
|
* @return string $varname name that is safe to use as a filename
|
||||||
*/
|
*/
|
||||||
function replace_slashes($name)
|
protected function clean_varname($varname)
|
||||||
{
|
{
|
||||||
return str_replace('/', '-', $name);
|
return str_replace('/', '-', $varname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue