From 687f5c6f096c8dbb379838d709b427b700655a47 Mon Sep 17 00:00:00 2001 From: Offerel Date: Tue, 15 Aug 2023 21:33:38 +0200 Subject: [PATCH] Fix deprecated null value --- CHANGELOG.md | 4 ++++ composer.json | 2 +- js/primitivenotes.js | 2 +- primitivenotes.php | 17 +++++++++-------- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4441b9..429402d 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ + +### v2.1.6 +- Fix deprecated null value + ### v2.1.5 - Fix some PHP8 warnings diff --git a/composer.json b/composer.json index 98ffbcc..5fbfdf1 100755 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "homepage": "https://codeberg.org/Offerel/roundcube_primitivenotes", "type": "roundcube-plugin", "license": "AGPL-3.0", - "version": "2.1.5", + "version": "2.1.6", "authors": [ { "name": "Offerel", diff --git a/js/primitivenotes.js b/js/primitivenotes.js index 97e2a28..6422c15 100755 --- a/js/primitivenotes.js +++ b/js/primitivenotes.js @@ -1,7 +1,7 @@ /** * Roundcube Notes Plugin * - * @version 2.1.5 + * @version 2.1.6 * @author Offerel * @copyright Copyright (c) 2023, Offerel * @license GNU General Public License, version 3 diff --git a/primitivenotes.php b/primitivenotes.php index cd5c420..fe5c566 100755 --- a/primitivenotes.php +++ b/primitivenotes.php @@ -2,7 +2,7 @@ /** * Roundcube Notes Plugin * - * @version 2.1.5 + * @version 2.1.6 * @author Offerel * @copyright Copyright (c) 2023, Offerel * @license GNU General Public License, version 3 @@ -67,13 +67,14 @@ function init() { $this->add_hook('message_compose', array($this, 'note_mail_compose')); $this->register_handler('plugin.notes_list', array($this, 'notes_list')); - $notes_path = $this->rc->config->get('notes_path', false); - $notes_path = (strpos($notes_path, '%u') === false) ? $notes_path:str_replace('%u', $this->rc->user->get_username(), $notes_path); - $this->notes_path = ($notes_path[-1] != '/') ? $notes_path.'/':$notes_path; - - $media_path = $this->notes_path.$this->rc->config->get('media_folder', false); - $this->media_path = ($media_path[-1] != '/') ? $media_path.'/':$media_path; - + if ($this->rc->task == 'notes') { + $notes_path = $this->rc->config->get('notes_path', false); + $notes_path = (strpos($notes_path, '%u') === false) ? $notes_path:str_replace('%u', $this->rc->user->get_username(), $notes_path); + $this->notes_path = ($notes_path[-1] != '/') ? $notes_path.'/':$notes_path; + $media_path = $this->notes_path.$this->rc->config->get('media_folder', false); + $this->media_path = ($media_path[-1] != '/') ? $media_path.'/':$media_path; + } + $this->formatter = new IntlDateFormatter($this->rc->get_user_language(), IntlDateFormatter::SHORT, IntlDateFormatter::SHORT); }