mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-10 18:54:08 +02:00
[ticket/17189] Check folder permissions before writing
PHPBB3-17189
This commit is contained in:
@@ -398,13 +398,13 @@ class filesystem implements filesystem_interface
|
||||
$file_gid = @filegroup($file);
|
||||
|
||||
// Change owner
|
||||
if ($file_uid !== $this->chmod_info['common_owner'])
|
||||
if (is_writable($file) && $file_uid !== $this->chmod_info['common_owner'])
|
||||
{
|
||||
$this->chown($file, $this->chmod_info['common_owner'], $recursive);
|
||||
}
|
||||
|
||||
// Change group
|
||||
if ($file_gid !== $this->chmod_info['common_group'])
|
||||
if (is_writable($file) && $file_gid !== $this->chmod_info['common_group'])
|
||||
{
|
||||
$this->chgrp($file, $this->chmod_info['common_group'], $recursive);
|
||||
}
|
||||
|
Reference in New Issue
Block a user