aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/console/command/thumbnail/delete.php
diff options
context:
space:
mode:
authorstevendegroote <stevendegroote@gmail.com>2019-09-17 23:15:54 +0200
committerstevendegroote <stevendegroote@gmail.com>2019-09-17 23:15:54 +0200
commitf8967fec78d826ea8d9ca34f65966ff8a7674b47 (patch)
treef9c5f408e7764ec6343e084e7fc6d62d07e3400f /phpBB/phpbb/console/command/thumbnail/delete.php
parentce93b224107a65b43253c36812b636321eb55a78 (diff)
parent4db585a4cb2e5359074a82ef088574609155294b (diff)
downloadforums-f8967fec78d826ea8d9ca34f65966ff8a7674b47.tar
forums-f8967fec78d826ea8d9ca34f65966ff8a7674b47.tar.gz
forums-f8967fec78d826ea8d9ca34f65966ff8a7674b47.tar.bz2
forums-f8967fec78d826ea8d9ca34f65966ff8a7674b47.tar.xz
forums-f8967fec78d826ea8d9ca34f65966ff8a7674b47.zip
Merge branch '3.2.x' into ticket/16159
Diffstat (limited to 'phpBB/phpbb/console/command/thumbnail/delete.php')
-rw-r--r--phpBB/phpbb/console/command/thumbnail/delete.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/phpBB/phpbb/console/command/thumbnail/delete.php b/phpBB/phpbb/console/command/thumbnail/delete.php
index cfa9891fbc..7b95c20cf2 100644
--- a/phpBB/phpbb/console/command/thumbnail/delete.php
+++ b/phpBB/phpbb/console/command/thumbnail/delete.php
@@ -19,6 +19,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
*/
protected $db;
@@ -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,13 +108,13 @@ 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))
{
$thumbnail_deleted[] = $row['attach_id'];
- if (sizeof($thumbnail_deleted) === 250)
+ if (count($thumbnail_deleted) === 250)
{
$this->commit_changes($thumbnail_deleted);
$thumbnail_deleted = array();