diff --git a/phpBB/adm/style/acp_storage.html b/phpBB/adm/style/acp_storage.html index 59389f1e44..248f658aa0 100644 --- a/phpBB/adm/style/acp_storage.html +++ b/phpBB/adm/style/acp_storage.html @@ -126,9 +126,9 @@
- - - + + +
diff --git a/phpBB/includes/acp/acp_storage.php b/phpBB/includes/acp/acp_storage.php index 601e829f6f..f98109be9b 100644 --- a/phpBB/includes/acp/acp_storage.php +++ b/phpBB/includes/acp/acp_storage.php @@ -181,7 +181,7 @@ class acp_storage } // If update_type is copy or move, copy files from the old to the new storage - if ($this->state['update_type'] >= 1) + if (in_array($this->state['update_type'], [STORAGE_UPDATE_TYPE_COPY, STORAGE_UPDATE_TYPE_MOVE], true)) { $i = 0; foreach ($this->state['storages'] as $storage_name => $storage_options) @@ -228,7 +228,7 @@ class acp_storage } // If update_type is move files, remove the old files - if ($this->state['update_type'] == 2) + if ($this->state['update_type'] === STORAGE_UPDATE_TYPE_MOVE) { $i = 0; foreach ($this->state['storages'] as $storage_name => $storage_options) @@ -355,7 +355,7 @@ class acp_storage $this->state = [ // Save the value of the checkbox, to remove all files from the // old storage once they have been successfully moved - 'update_type' => $this->request->variable('update_type', 0), + 'update_type' => (int) $this->request->variable('update_type', STORAGE_UPDATE_TYPE_CONFIG), 'storage_index' => 0, 'file_index' => 0, 'remove_storage_index' => 0, diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index f560dbfbcb..460cdf0443 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -228,6 +228,11 @@ define('CAPTCHA_MAX_CHARS', 7); // Additional constants define('VOTE_CONVERTED', 127); +// Storage update methods +define('STORAGE_UPDATE_TYPE_CONFIG', 0); +define('STORAGE_UPDATE_TYPE_COPY', 1); +define('STORAGE_UPDATE_TYPE_MOVE', 2); + // BC global FTW global $table_prefix;