From 4477f95426a0340cf37f8be7004ffa8556fc8482 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Sun, 23 Mar 2025 18:41:09 +0100 Subject: [PATCH] AdminerEditCalendar: Avoid work in constructor --- adminer/include/connect.inc.php | 3 +-- plugins/edit-calendar.php | 14 ++++++-------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/adminer/include/connect.inc.php b/adminer/include/connect.inc.php index 5f2f2e76..7fd52fe0 100644 --- a/adminer/include/connect.inc.php +++ b/adminer/include/connect.inc.php @@ -48,8 +48,7 @@ if ( echo "

" . lang('Loaded plugins') . ":\n

\n"; } diff --git a/plugins/edit-calendar.php b/plugins/edit-calendar.php index 466e7a58..00b93a6d 100644 --- a/plugins/edit-calendar.php +++ b/plugins/edit-calendar.php @@ -16,19 +16,17 @@ class AdminerEditCalendar { * @param string path to language file, %s stands for language code */ function __construct($prepend = null, $langPath = "jquery-ui/i18n/jquery.ui.datepicker-%s.js") { - if ($prepend === null) { - $prepend = "\n" - . Adminer\script_src("jquery-ui/jquery.js") - . Adminer\script_src("jquery-ui/jquery-ui.js") - . Adminer\script_src("jquery-ui/jquery-ui-timepicker-addon.js") - ; - } $this->prepend = $prepend; $this->langPath = $langPath; } function head($dark = null) { - echo $this->prepend; + echo ($this->prepend !== null ? $this->prepend : + "\n" + . Adminer\script_src("jquery-ui/jquery.js") + . Adminer\script_src("jquery-ui/jquery-ui.js") + . Adminer\script_src("jquery-ui/jquery-ui-timepicker-addon.js") + ); if ($this->langPath) { $lang = Adminer\get_lang(); $lang = ($lang == "zh" ? "zh-CN" : ($lang == "zh-tw" ? "zh-TW" : $lang));