[ticket/16351] Use CHMOD constants from filesystem_interface

PHPBB3-16351
This commit is contained in:
rubencm 2020-02-02 22:00:38 +00:00
parent 7de24bad2e
commit 9749aa936c
7 changed files with 15 additions and 15 deletions

View file

@ -1480,7 +1480,7 @@ class acp_attachments
try
{
$this->filesystem->phpbb_chmod($phpbb_root_path . $upload_dir, CHMOD_READ | CHMOD_WRITE);
$this->filesystem->phpbb_chmod($phpbb_root_path . $upload_dir, \phpbb\filesystem\filesystem_interface::CHMOD_READ | \phpbb\filesystem\filesystem_interface::CHMOD_WRITE);
}
catch (\phpbb\filesystem\exception\filesystem_exception $e)
{

View file

@ -225,10 +225,10 @@ define('REFERER_VALIDATE_HOST', 1);
define('REFERER_VALIDATE_PATH', 2);
// phpbb_chmod() permissions
@define('CHMOD_ALL', 7);
@define('CHMOD_READ', 4);
@define('CHMOD_WRITE', 2);
@define('CHMOD_EXECUTE', 1);
@define('CHMOD_ALL', 7); // @deprecated 3.2
@define('CHMOD_READ', 4); // @deprecated 3.2
@define('CHMOD_WRITE', 2); // @deprecated 3.2
@define('CHMOD_EXECUTE', 1); // @deprecated 3.2
// Captcha code length
define('CAPTCHA_MIN_CHARS', 4);

View file

@ -296,7 +296,7 @@ class compress_zip extends compress
try
{
$this->filesystem->phpbb_chmod($str, CHMOD_READ | CHMOD_WRITE);
$this->filesystem->phpbb_chmod($str, \phpbb\filesystem\filesystem_interface::CHMOD_READ | \phpbb\filesystem\filesystem_interface::CHMOD_WRITE);
}
catch (\phpbb\filesystem\exception\filesystem_exception $e)
{
@ -333,7 +333,7 @@ class compress_zip extends compress
try
{
$this->filesystem->phpbb_chmod($str, CHMOD_READ | CHMOD_WRITE);
$this->filesystem->phpbb_chmod($str, \phpbb\filesystem\filesystem_interface::CHMOD_READ | \phpbb\filesystem\filesystem_interface::CHMOD_WRITE);
}
catch (\phpbb\filesystem\exception\filesystem_exception $e)
{
@ -636,7 +636,7 @@ class compress_tar extends compress
try
{
$this->filesystem->phpbb_chmod($str, CHMOD_READ | CHMOD_WRITE);
$this->filesystem->phpbb_chmod($str, \phpbb\filesystem\filesystem_interface::CHMOD_READ | \phpbb\filesystem\filesystem_interface::CHMOD_WRITE);
}
catch (\phpbb\filesystem\exception\filesystem_exception $e)
{
@ -671,7 +671,7 @@ class compress_tar extends compress
try
{
$this->filesystem->phpbb_chmod($str, CHMOD_READ | CHMOD_WRITE);
$this->filesystem->phpbb_chmod($str, \phpbb\filesystem\filesystem_interface::CHMOD_READ | \phpbb\filesystem\filesystem_interface::CHMOD_WRITE);
}
catch (\phpbb\filesystem\exception\filesystem_exception $e)
{
@ -688,7 +688,7 @@ class compress_tar extends compress
try
{
$this->filesystem->phpbb_chmod($target_filename, CHMOD_READ);
$this->filesystem->phpbb_chmod($target_filename, \phpbb\filesystem\filesystem_interface::CHMOD_READ);
}
catch (\phpbb\filesystem\exception\filesystem_exception $e)
{

View file

@ -1013,7 +1013,7 @@ class queue
try
{
$this->filesystem->phpbb_chmod($this->cache_file, CHMOD_READ | CHMOD_WRITE);
$this->filesystem->phpbb_chmod($this->cache_file, \phpbb\filesystem\filesystem_interface::CHMOD_READ | \phpbb\filesystem\filesystem_interface::CHMOD_WRITE);
}
catch (\phpbb\filesystem\exception\filesystem_exception $e)
{
@ -1067,7 +1067,7 @@ class queue
try
{
$this->filesystem->phpbb_chmod($this->cache_file, CHMOD_READ | CHMOD_WRITE);
$this->filesystem->phpbb_chmod($this->cache_file, \phpbb\filesystem\filesystem_interface::CHMOD_READ | \phpbb\filesystem\filesystem_interface::CHMOD_WRITE);
}
catch (\phpbb\filesystem\exception\filesystem_exception $e)
{

View file

@ -717,7 +717,7 @@ function create_thumbnail($source, $destination, $mimetype)
try
{
$phpbb_filesystem->phpbb_chmod($destination, CHMOD_READ | CHMOD_WRITE);
$phpbb_filesystem->phpbb_chmod($destination, \phpbb\filesystem\filesystem_interface::CHMOD_READ | \phpbb\filesystem\filesystem_interface::CHMOD_WRITE);
}
catch (\phpbb\filesystem\exception\filesystem_exception $e)
{

View file

@ -581,7 +581,7 @@ class file extends \phpbb\cache\driver\base
try
{
$this->filesystem->phpbb_chmod($file, CHMOD_READ | CHMOD_WRITE);
$this->filesystem->phpbb_chmod($file, \phpbb\filesystem\filesystem_interface::CHMOD_READ | \phpbb\filesystem\filesystem_interface::CHMOD_WRITE);
}
catch (\phpbb\filesystem\exception\filesystem_exception $e)
{

View file

@ -408,7 +408,7 @@ class filespec
return false;
}
$chmod = ($chmod === false) ? CHMOD_READ | CHMOD_WRITE : $chmod;
$chmod = ($chmod === false) ? \phpbb\filesystem\filesystem_interface::CHMOD_READ | \phpbb\filesystem\filesystem_interface::CHMOD_WRITE : $chmod;
// We need to trust the admin in specifying valid upload directories and an attacker not being able to overwrite it...
$this->destination_path = $this->phpbb_root_path . $destination;