diff options
author | 3D-I <eataly3d@gmail.com> | 2019-08-13 04:59:29 +0200 |
---|---|---|
committer | 3D-I <eataly3d@gmail.com> | 2019-08-13 05:01:09 +0200 |
commit | af84fb71e065c99f94dd4781f42fc55e923821cf (patch) | |
tree | bac7da03789f525c3d51ed42b51383772e276277 /phpBB/includes/acp/acp_styles.php | |
parent | 3fbdb2f345cc5fb132755033ba3b9d2fa061218e (diff) | |
download | forums-af84fb71e065c99f94dd4781f42fc55e923821cf.tar forums-af84fb71e065c99f94dd4781f42fc55e923821cf.tar.gz forums-af84fb71e065c99f94dd4781f42fc55e923821cf.tar.bz2 forums-af84fb71e065c99f94dd4781f42fc55e923821cf.tar.xz forums-af84fb71e065c99f94dd4781f42fc55e923821cf.zip |
[ticket/16019] Move code to before of confirm box is submitted
PHPBB3-16019
Diffstat (limited to 'phpBB/includes/acp/acp_styles.php')
-rw-r--r-- | phpBB/includes/acp/acp_styles.php | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 1983dff1cc..16ad8c5320 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -259,6 +259,19 @@ class acp_styles // Get list of styles to uninstall $ids = $this->request_vars('id', 0, true); + // Don't remove prosilver, you can still deactivate it. + $sql = 'SELECT style_id + FROM ' . STYLES_TABLE . " + WHERE style_name = '" . $this->db->sql_escape('prosilver') . "'"; + $result = $this->db->sql_query($sql); + $prosilver_id = (int) $this->db->sql_fetchrow($result); + $this->db->sql_freeresult($result); + + if (in_array($prosilver_id, $ids)) + { + trigger_error($this->user->lang['UNINSTALL_PROSILVER'] . adm_back_link($this->u_action), E_USER_WARNING); + } + // Check if confirmation box was submitted if (confirm_box(true)) { @@ -289,14 +302,6 @@ class acp_styles { global $user, $phpbb_log; - // Don't remove prosilver, you can still deactivate it. - $sql = 'SELECT style_id - FROM ' . STYLES_TABLE . " - WHERE style_name = '" . $this->db->sql_escape('prosilver') . "'"; - $result = $this->db->sql_query($sql); - $prosilver_id = (int) $this->db->sql_fetchrow($result); - $this->db->sql_freeresult($result); - $default = $this->default_style; $uninstalled = array(); $messages = array(); @@ -304,10 +309,6 @@ class acp_styles // Check styles list foreach ($ids as $id) { - if ($id == $prosilver_id) - { - trigger_error($this->user->lang['UNINSTALL_PROSILVER'] . adm_back_link($this->u_action), E_USER_WARNING); - } if (!$id) { trigger_error($this->user->lang['INVALID_STYLE_ID'] . adm_back_link($this->u_action), E_USER_WARNING); |