From 3d2e56948e131211fecb0d364c3e64ed0dd615f9 Mon Sep 17 00:00:00 2001 From: onli Date: Sun, 6 Jun 2021 21:49:21 +0200 Subject: [PATCH] template editor 0.8.2: PHP 8 compatibility fixes --- serendipity_event_template_editor/ChangeLog | 2 ++ .../serendipity_event_template_editor.php | 20 +++++++------------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/serendipity_event_template_editor/ChangeLog b/serendipity_event_template_editor/ChangeLog index 13cd56cb..5ba17176 100644 --- a/serendipity_event_template_editor/ChangeLog +++ b/serendipity_event_template_editor/ChangeLog @@ -1,3 +1,5 @@ +0.8.2: PHP 8 compatibility fix + 0.8.1: Iconfont a11y fix (yellowled) 0.8: Adapt backend to 2.x (yellowled) diff --git a/serendipity_event_template_editor/serendipity_event_template_editor.php b/serendipity_event_template_editor/serendipity_event_template_editor.php index b9384176..7d0814fa 100644 --- a/serendipity_event_template_editor/serendipity_event_template_editor.php +++ b/serendipity_event_template_editor/serendipity_event_template_editor.php @@ -4,14 +4,7 @@ if (IN_serendipity !== true) { die ("Don't hack!"); } - -// Probe for a language include with constants. Still include defines later on, if some constants were missing -$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php'; -if (file_exists($probelang)) { - include $probelang; -} - -include dirname(__FILE__) . '/lang_en.inc.php'; +@serendipity_plugin_api::load_language(dirname(__FILE__)); class serendipity_event_template_editor extends serendipity_event { var $title = PLUGIN_EVENT_TEMPLATE_EDITOR_NAME; @@ -25,7 +18,7 @@ class serendipity_event_template_editor extends serendipity_event { $propbag->add('stackable', false); $propbag->add('author', 'Malte Paskuda'); $propbag->add('license', 'GPL'); - $propbag->add('version', '0.8.1'); + $propbag->add('version', '0.8.2'); $propbag->add('requirements', array( 'serendipity' => '2.0' )); @@ -232,9 +225,9 @@ class serendipity_event_template_editor extends serendipity_event { echo ''; } if (isset($serendipity['GET']['template_editor_use_temp'])) { - $this->showEditor($serendipity['GET']['template_editor_path'] . $serendipity['GET']['editfile'], true); + $this->showEditor($serendipity['GET']['template_editor_path'] . ($serendipity['GET']['editfile'] ?? ''), true); } else { - $this->showEditor($serendipity['GET']['template_editor_path'] . $serendipity['GET']['editfile']); + $this->showEditor($serendipity['GET']['template_editor_path'] . ($serendipity['GET']['editfile'] ?? '')); } } break; @@ -339,7 +332,8 @@ class serendipity_event_template_editor extends serendipity_event { } echo '