From 2335143b343b98d0e79c6c5990b760358b98c02b Mon Sep 17 00:00:00 2001 From: ruan <2369127-ruany@users.noreply.gitlab.com> Date: Mon, 4 May 2020 09:27:07 +0200 Subject: [PATCH] Simplify init_tables --- inc/settings.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/inc/settings.php b/inc/settings.php index 87c8580..dd6d9f3 100644 --- a/inc/settings.php +++ b/inc/settings.php @@ -257,7 +257,6 @@ class Settings { } } - private function test_strftime() { // If you modify this function, you may get an "Assertion failed" error. date_default_timezone_set("UTC"); // temporarily set UTC timezone for testing purposes @@ -280,17 +279,11 @@ class Settings { date_default_timezone_set($this->timezone); // set configured timezone } + protected function init_tables() { - $table_prefix = $this->table_prefix; - // Internal table names, do not translate. - $this->table = array( - 'bans' => "${table_prefix}bans", - 'mutes' => "${table_prefix}mutes", - 'warnings' => "${table_prefix}warnings", - 'kicks' => "${table_prefix}kicks", - 'history' => "${table_prefix}history", - 'servers' => "${table_prefix}servers", - 'config' => "${table_prefix}config", - ); + $this->table = array(); + array_map(function ($t) { + $this->table[$t] = $this->table_prefix . $t; + }, array('bans', 'mutes', 'warnings', 'kicks', 'history', 'servers', 'config')); } }