From d97165e4278a126666f1f2bccf65c4b748dafc9e Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Mon, 24 Apr 2023 15:48:48 +0200 Subject: [PATCH] fix nullsafe warning --- _define.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/_define.php b/_define.php index 4cf98d6..dd2ef31 100644 --- a/_define.php +++ b/_define.php @@ -10,7 +10,7 @@ * @copyright Jean-Christian Denis * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html */ -if (!defined('DC_RC_PATH')) { +if (!defined('DC_RC_PATH') || is_null(dcCore::app()->auth)) { return null; } @@ -22,7 +22,7 @@ $this->registerModule( [ 'requires' => [['core', '2.24']], 'permissions' => dcCore::app()->auth->makePermissions([ - dcAuth::PERMISSION_USAGE, + dcCore::app()->auth::PERMISSION_USAGE, ]), 'type' => 'plugin', 'support' => 'https://github.com/JcDenis/' . basename(__DIR__), @@ -36,9 +36,9 @@ if (!function_exists('\_mail')) { { $headers = is_array($headers) ? implode("\n\t", $headers) : (string) $headers; - $cur = dcCore::app()->con->openCursor(dcCore::app()->prefix . dcLog::LOG_TABLE_NAME); - $cur->log_table = basename(__DIR__); - $cur->log_msg = sprintf("%s\n-----\n To: %s\n Subject: %s\n-----\n Message:\n%s\n", $headers, $to, $subject, $message); + $cur = dcCore::app()->con->openCursor(dcCore::app()->prefix . dcLog::LOG_TABLE_NAME); + $cur->setField('log_table', basename(__DIR__)); + $cur->setField('log_msg', sprintf("%s\n-----\n To: %s\n Subject: %s\n-----\n Message:\n%s\n", $headers, $to, $subject, $message)); dcCore::app()->log->addLog($cur); return true;