phpBB

Code Changes

File: phpbb/cache/driver/file.php

  Unmodified   Added   Modified   Removed
Line 279Line 279
		if ($var_name[0] == '_')
{
global $phpEx;

		if ($var_name[0] == '_')
{
global $phpEx;

 
			$var_name = $this->clean_varname($var_name);

			return file_exists($this->cache_dir . 'data' . $var_name . ".$phpEx");
}
else

			return file_exists($this->cache_dir . 'data' . $var_name . ".$phpEx");
}
else

Line 334Line 335
	{
global $phpEx;


	{
global $phpEx;


 
		$filename = $this->clean_varname($filename);

		$file = "{$this->cache_dir}$filename.$phpEx";

$type = substr($filename, 0, strpos($filename, '_'));

		$file = "{$this->cache_dir}$filename.$phpEx";

$type = substr($filename, 0, strpos($filename, '_'));

Line 516Line 518
	{
global $phpEx;


	{
global $phpEx;


 
		$filename = $this->clean_varname($filename);

		$file = "{$this->cache_dir}$filename.$phpEx";

$lock = new \phpbb\lock\flock($file);

		$file = "{$this->cache_dir}$filename.$phpEx";

$lock = new \phpbb\lock\flock($file);

Line 564Line 567
			}

fclose($handle);

			}

fclose($handle);

 

if (function_exists('opcache_invalidate'))
{
@opcache_invalidate($file);
}


if (!function_exists('phpbb_chmod'))
{


if (!function_exists('phpbb_chmod'))
{

Line 583Line 591
		$lock->release();

return $return_value;

		$lock->release();

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);

	}
}


	}
}