From fd0632f3927cdc973e6ea425647d0da99c821bca Mon Sep 17 00:00:00 2001 From: Jon Stovell Date: Mon, 13 Nov 2023 15:44:00 -0700 Subject: [PATCH 1/3] Removes an obsolete require_once call Signed-off-by: Jon Stovell --- Sources/Actions/Profile/ShowAlerts.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/Sources/Actions/Profile/ShowAlerts.php b/Sources/Actions/Profile/ShowAlerts.php index 62f48944bb..538bf776f9 100644 --- a/Sources/Actions/Profile/ShowAlerts.php +++ b/Sources/Actions/Profile/ShowAlerts.php @@ -64,8 +64,6 @@ class ShowAlerts implements ActionInterface */ public function execute(): void { - require_once(Config::$sourcedir . '/Actions/Profile/Modify.php'); - // Are we opening a specific alert? (i.e.: ?action=profile;area=showalerts;alert=12345) if (!empty($_REQUEST['alert'])) { From 107cea99c2b0ff4fe6b1cc221086ea7829f32b0b Mon Sep 17 00:00:00 2001 From: Jon Stovell Date: Mon, 13 Nov 2023 15:50:00 -0700 Subject: [PATCH 2/3] Fixes bugs in SMF\Alert::createBatch() Signed-off-by: Jon Stovell --- Sources/Alert.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Alert.php b/Sources/Alert.php index 5912d46c76..4f8a4ff6fd 100644 --- a/Sources/Alert.php +++ b/Sources/Alert.php @@ -649,7 +649,7 @@ public static function createBatch(array $props_batch = array()): array $possible_topics = array(); // First, weed out any alerts that wouldn't be visible. - foreach ($props_batch as $props) + foreach ($props_batch as &$props) { $members[] = $props['id_member']; From 09e2ac1cd03254db51e4d79743875a79a55c6241 Mon Sep 17 00:00:00 2001 From: Jon Stovell Date: Mon, 13 Nov 2023 15:51:56 -0700 Subject: [PATCH 3/3] Fixes a couple of bugs in SMF\Tasks\EventNew_Notify Signed-off-by: Jon Stovell --- Sources/Actions/Notify.php | 2 +- Sources/tasks/EventNew_Notify.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/Actions/Notify.php b/Sources/Actions/Notify.php index 78d3197fbb..5df392ca78 100644 --- a/Sources/Actions/Notify.php +++ b/Sources/Actions/Notify.php @@ -174,7 +174,7 @@ public function execute(): void public static function getNotifyPrefs($members, $prefs = '', $process_default = false) { // We want this as an array whether it is or not. - $members = is_array($members) ? $members : (array) $members; + $members = array_map('intval', (array) $members); if (!empty($prefs)) $prefs = is_array($prefs) ? $prefs : (array) $prefs; diff --git a/Sources/tasks/EventNew_Notify.php b/Sources/tasks/EventNew_Notify.php index 0855087646..3dd4c8a635 100644 --- a/Sources/tasks/EventNew_Notify.php +++ b/Sources/tasks/EventNew_Notify.php @@ -39,7 +39,7 @@ public function execute() // Don't alert the event creator if (!empty($this->_details['sender_id'])) - $members = array_diff($members, array($this->_details['sender_id'])); + $members = array_diff($members, $this->_details['sender_id']); // Having successfully figured this out, now let's get the preferences of everyone. $prefs = Notify::getNotifyPrefs($members, 'event_new', true); @@ -85,7 +85,7 @@ public function execute() 'content_id' => $this->_details['event_id'], 'content_action' => empty($this->_details['sender_id']) ? 'new_guest' : 'new', 'is_read' => 0, - 'extra' => Db::$db->smcFunc['json_encode']( + 'extra' => Utils::jsonEncode( array( "event_id" => $this->_details['event_id'], "event_title" => $this->_details['event_title']