From 68dd129c0f9db866b2907a41ad8e3d47af53ac12 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Sun, 28 Jun 2026 13:16:11 -0500 Subject: [PATCH] fix: XSS escaping in menu, SPDX header, orphaned docblock, getDbo() - htmlspecialchars() on all icon/title output in menu module - SPDX license header on cache Dispatcher - Moved orphaned requestNew() docblock to correct location - Replaced deprecated Factory::getDbo() with DI container pattern Claude-Session: https://claude.ai/code/session_01Jo2JpjCwfHAh2HHRSjczKq --- .../admin/src/Helper/SupportPinHelper.php | 14 +++++++------- .../admin/src/View/Dashboard/HtmlView.php | 2 +- .../src/Dispatcher/Dispatcher.php | 9 +++++++++ .../mod_mokosuiteclient_menu/tmpl/default.php | 12 ++++++------ 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/source/packages/com_mokosuiteclient/admin/src/Helper/SupportPinHelper.php b/source/packages/com_mokosuiteclient/admin/src/Helper/SupportPinHelper.php index 8119c97d..73215741 100644 --- a/source/packages/com_mokosuiteclient/admin/src/Helper/SupportPinHelper.php +++ b/source/packages/com_mokosuiteclient/admin/src/Helper/SupportPinHelper.php @@ -108,13 +108,6 @@ class SupportPinHelper return 'MOKO-' . strtoupper(substr($hash, 0, 4)) . '-' . strtoupper(substr($hash, 4, 4)); } - /** - * Request a new PIN: stamps the current time into plugin params and returns the PIN. - * - * @param DatabaseInterface $db Database driver. - * - * @return array{success: bool, pin?: string, message: string} - */ /** * Render PIN badge HTML (active PIN with copy, or request button). * @@ -257,6 +250,13 @@ class SupportPinHelper JS; } + /** + * Request a new PIN: stamps the current time into plugin params and returns the PIN. + * + * @param DatabaseInterface $db Database driver. + * + * @return array{success: bool, pin?: string, message: string} + */ public static function requestNew(DatabaseInterface $db): array { $state = self::getState($db); diff --git a/source/packages/com_mokosuiteclient/admin/src/View/Dashboard/HtmlView.php b/source/packages/com_mokosuiteclient/admin/src/View/Dashboard/HtmlView.php index 60ce45b3..dae6aef9 100644 --- a/source/packages/com_mokosuiteclient/admin/src/View/Dashboard/HtmlView.php +++ b/source/packages/com_mokosuiteclient/admin/src/View/Dashboard/HtmlView.php @@ -46,7 +46,7 @@ class HtmlView extends BaseHtmlView // Detect Regular Labs data for import (source table must exist AND our destination table) try { - $rlDb = \Joomla\CMS\Factory::getDbo(); + $rlDb = \Joomla\CMS\Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class); $rlTables = $rlDb->getTableList(); $rlPrefix = $rlDb->getPrefix(); $this->regularLabsAvailable = diff --git a/source/packages/mod_mokosuiteclient_cache/src/Dispatcher/Dispatcher.php b/source/packages/mod_mokosuiteclient_cache/src/Dispatcher/Dispatcher.php index 54b1a79b..8ef4f512 100644 --- a/source/packages/mod_mokosuiteclient_cache/src/Dispatcher/Dispatcher.php +++ b/source/packages/mod_mokosuiteclient_cache/src/Dispatcher/Dispatcher.php @@ -1,4 +1,13 @@
  • - - + +