From a590d0dca0cea8658d0376a1efd9486695d03491 Mon Sep 17 00:00:00 2001 From: bryanhoffman Date: Fri, 6 Feb 2026 01:40:59 -0600 Subject: [PATCH 1/2] used ENT_NOQUOTES flag to preserve single and double quotes in Signed-off-by: Bryan Hoffman --- src/Controllers/Database/EventsController.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Controllers/Database/EventsController.php b/src/Controllers/Database/EventsController.php index ee0cf17b49..fe31e1e139 100644 --- a/src/Controllers/Database/EventsController.php +++ b/src/Controllers/Database/EventsController.php @@ -202,15 +202,17 @@ final class EventsController implements InvocableController $itemName = htmlspecialchars(Util::backquote($itemName)); if ($exportData !== false) { - $exportData = htmlspecialchars(trim($exportData)); $title = sprintf(__('Export of event %s'), $itemName); if ($request->isAjax()) { - $this->response->addJSON('message', $exportData); + $exportData = htmlspecialchars(trim($exportData)); + $this->response->addJSON('message', $exportData); $this->response->addJSON('title', $title); return $this->response->response(); - } + } else { + $exportData = htmlspecialchars(trim($exportData),ENT_NOQUOTES); + } $output = '
'; $output .= '

' . $title . '

'; From d9c2a92d4e5ee57a651f8629999301731a6fb9a6 Mon Sep 17 00:00:00 2001 From: bryanhoffman Date: Sat, 7 Feb 2026 16:09:48 -0600 Subject: [PATCH 2/2] Used PHPCBF to wrangle code to project standards Signed-off-by: Bryan Hoffman --- src/Controllers/Database/EventsController.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Controllers/Database/EventsController.php b/src/Controllers/Database/EventsController.php index fe31e1e139..3b8625a85c 100644 --- a/src/Controllers/Database/EventsController.php +++ b/src/Controllers/Database/EventsController.php @@ -24,6 +24,8 @@ use function mb_strtoupper; use function sprintf; use function trim; +use const ENT_NOQUOTES; + #[Route('/database/events', ['GET', 'POST'])] final class EventsController implements InvocableController { @@ -205,14 +207,14 @@ final class EventsController implements InvocableController $title = sprintf(__('Export of event %s'), $itemName); if ($request->isAjax()) { - $exportData = htmlspecialchars(trim($exportData)); - $this->response->addJSON('message', $exportData); + $exportData = htmlspecialchars(trim($exportData)); + $this->response->addJSON('message', $exportData); $this->response->addJSON('title', $title); return $this->response->response(); - } else { - $exportData = htmlspecialchars(trim($exportData),ENT_NOQUOTES); - } + } + + $exportData = htmlspecialchars(trim($exportData), ENT_NOQUOTES); $output = '
'; $output .= '

' . $title . '

';