From e83820bb5e9a77650a384d3f1256993e08b760a0 Mon Sep 17 00:00:00 2001 From: onli Date: Sun, 6 Jun 2021 13:17:23 +0200 Subject: [PATCH] livecomment 2.5.6: PHP 8 compatibility fixes --- serendipity_event_livecomment/ChangeLog | 3 ++ .../serendipity_event_livecomment.php | 32 ++++++++----------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/serendipity_event_livecomment/ChangeLog b/serendipity_event_livecomment/ChangeLog index 517499c8..c9a2220f 100755 --- a/serendipity_event_livecomment/ChangeLog +++ b/serendipity_event_livecomment/ChangeLog @@ -1,3 +1,6 @@ +2.5.6: + * PHP 8 compatibility fixes + 2.5.4: * Made jQuery-Scripts compatible to other frameworks * Don't link to javascript when not on a singly entry diff --git a/serendipity_event_livecomment/serendipity_event_livecomment.php b/serendipity_event_livecomment/serendipity_event_livecomment.php index b7bbe9d2..d03bd1ac 100644 --- a/serendipity_event_livecomment/serendipity_event_livecomment.php +++ b/serendipity_event_livecomment/serendipity_event_livecomment.php @@ -5,13 +5,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_livecomment extends serendipity_event { @@ -27,9 +21,9 @@ class serendipity_event_livecomment extends serendipity_event $propbag->add('author', 'Malte Paskuda, Garvin Hicking'); $propbag->add('requirements', array( 'serendipity' => '1.0', - 'php' => '4.1.0' + 'php' => '7.0' )); - $propbag->add('version', '2.5.5'); + $propbag->add('version', '2.5.6'); $propbag->add('event_hooks', array( 'frontend_footer' => true, 'external_plugin' => true, @@ -145,34 +139,34 @@ class serendipity_event_livecomment extends serendipity_event $hooks = &$bag->get('event_hooks'); if (isset($hooks[$event])) { - if ($variant === null) { + if (($variant ?? null) === null) { $variant = $this->get_config('variant', 'jquery'); } - if ($buttons === null) { + if (($buttons ?? null) === null) { $buttons = serendipity_db_bool($this->get_config('buttons', true)); } - if ($timeout === null) { + if (($timeout ?? null) === null) { $timeout = $this->get_config('timeout', ''); } - if ($preview_animation === null) { + if (($preview_animation ?? null) === null) { $preview_animation = $this->get_config('preview_animation', 'fadeIn'); } - if ($preview_animation_speed === null) { + if (($preview_animation_speed ?? null) === null) { $preview_animation_speed = $this->get_config('preview_animation_speed', 'slow'); } - if ($button_animation === null) { + if (($button_animation ?? null) === null) { $button_animation = $this->get_config('button_animation', 'slideDown'); } - if ($button_animation_speed === null) { + if (($button_animation_speed ?? null) === null) { $button_animation_speed = $this->get_config('button_animation_speed', 'slow'); } - if ($elastic === null) { + if (($elastic ?? null) === null) { $elastic = serendipity_db_bool($this->get_config('elastic', false)); } - if ($inline === null) { + if (($inline ?? null) === null) { $inline = serendipity_db_bool($this->get_config('inline', false)); } - if ($path === null) { + if (($path ?? null) === null) { $path = $this->get_config('path', ''); } if (!empty($path) && $path != 'default' && $path != 'none' && $path != 'empty') {