1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-13 04:04:12 +02:00

[ticket/15965] Fix hardcoded directory

PHPBB3-15965
This commit is contained in:
rubencm
2019-02-09 12:16:47 +00:00
parent 33afd3f350
commit 96491a70e8
4 changed files with 24 additions and 7 deletions

View File

@@ -18,6 +18,11 @@ use Symfony\Component\Console\Style\SymfonyStyle;
class delete extends \phpbb\console\command\command
{
/**
* @var \phpbb\config\config
*/
protected $config;
/**
* @var \phpbb\db\driver\driver_interface
*/
@@ -32,12 +37,14 @@ class delete extends \phpbb\console\command\command
/**
* Constructor
*
* @param \config\config $config The config
* @param \phpbb\user $user The user object (used to get language information)
* @param \phpbb\db\driver\driver_interface $db Database connection
* @param string $phpbb_root_path Root path
*/
public function __construct(\phpbb\user $user, \phpbb\db\driver\driver_interface $db, $phpbb_root_path)
public function __construct(\phpbb\config\config $config, \phpbb\user $user, \phpbb\db\driver\driver_interface $db, $phpbb_root_path)
{
$this->config = $config;
$this->db = $db;
$this->phpbb_root_path = $phpbb_root_path;
@@ -101,7 +108,7 @@ class delete extends \phpbb\console\command\command
$return = 0;
while ($row = $this->db->sql_fetchrow($result))
{
$thumbnail_path = $this->phpbb_root_path . 'files/thumb_' . $row['physical_filename'];
$thumbnail_path = $this->phpbb_root_path . $this->config['upload_path'] . '/thumb_' . $row['physical_filename'];
if (@unlink($thumbnail_path))
{