From 4d496ba645ce0633fd772eb0c6932807b6355ab2 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sun, 26 Mar 2023 16:00:38 +0700 Subject: [PATCH] Added missing default statement in switch case (#653) --- library/ajax/index_data.php | 3 +++ library/ajax/manage_admin.php | 3 +++ library/ajax/manage_user.php | 3 +++ library/ajax/mod_action.php | 3 +++ library/ajax/user_register.php | 3 +++ src/Legacy/Caches.php | 3 ++- 6 files changed, 17 insertions(+), 1 deletion(-) diff --git a/library/ajax/index_data.php b/library/ajax/index_data.php index 2395718a8..982f1f4d5 100644 --- a/library/ajax/index_data.php +++ b/library/ajax/index_data.php @@ -132,6 +132,9 @@ switch ($mode) { ' . $user_ratio . ' '; break; + + default: + $this->ajax_die('Invalid mode'); } $this->response['html'] = $html; diff --git a/library/ajax/manage_admin.php b/library/ajax/manage_admin.php index 4f174a5d7..df99dbfa7 100644 --- a/library/ajax/manage_admin.php +++ b/library/ajax/manage_admin.php @@ -110,6 +110,9 @@ switch ($mode) { $this->response['unlock_cron_html'] = '' . $lang['ADMIN_UNLOCKED'] . ''; break; + + default: + $this->ajax_die('Invalid mode'); } $this->response['mode'] = $mode; diff --git a/library/ajax/manage_user.php b/library/ajax/manage_user.php index 63741ae28..8ca5890d4 100644 --- a/library/ajax/manage_user.php +++ b/library/ajax/manage_user.php @@ -104,6 +104,9 @@ switch ($mode) { $this->response['info'] = $lang['USER_ACTIVATE_OFF']; break; + + default: + $this->ajax_die('Invalid mode'); } $this->response['mode'] = $mode; diff --git a/library/ajax/mod_action.php b/library/ajax/mod_action.php index 371b8c779..9648e5a67 100644 --- a/library/ajax/mod_action.php +++ b/library/ajax/mod_action.php @@ -133,4 +133,7 @@ switch ($mode) {
'; break; + + default: + $this->ajax_die('Invalid mode'); } diff --git a/library/ajax/user_register.php b/library/ajax/user_register.php index 6a7518ee0..2638943c7 100644 --- a/library/ajax/user_register.php +++ b/library/ajax/user_register.php @@ -44,6 +44,9 @@ switch ($mode) { $html = ' ' . $text . ''; } break; + + default: + $this->ajax_die('Invalid mode'); } $this->response['html'] = $html; diff --git a/src/Legacy/Caches.php b/src/Legacy/Caches.php index 461b3715b..993952bf3 100644 --- a/src/Legacy/Caches.php +++ b/src/Legacy/Caches.php @@ -71,7 +71,8 @@ class Caches $this->ref[$cache_name] =& $this->obj[$cache_name]; break; - default: //filecache + case 'filecache': + default: if (!isset($this->obj[$cache_name])) { $this->obj[$cache_name] = new Cache\File($this->cfg['db_dir'] . $cache_name . '/', $this->cfg['prefix']); }