From 783f2de0cc9229de7c28f99f2a1c85f28f3b5cc6 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 17 Mar 2007 18:36:36 +0000 Subject: [PATCH] r1472: Fix a string offset bug due to those annoying uses of construct_user_display() in NotificationCenter --- docs/changes.txt | 1 + includes/class_notification.php | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 0b772a5..f53e399 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -3,6 +3,7 @@ - Fixed: Emails wouldn't be sent out for new comments due to a bug with updating the notices array - Fixed: Searches wouldn't be rerun after 15 minutes because of a typo in the time calculation - Fixed: The installer would show an error if gettext wasn't installed because the emulator wasn't loaded early enough +- Fixed: Close a large bug that would cause a PHP error to be thrown regarding string offsets during notification processing 1.2.0 Beta 1 =============================== diff --git a/includes/class_notification.php b/includes/class_notification.php index 567afb4..1d4184c 100644 --- a/includes/class_notification.php +++ b/includes/class_notification.php @@ -507,17 +507,17 @@ class NotificationCenter WHERE useremail.relation = 0 AND useremail.mask & " . $this->registry->emailoptions['notifications']['newbug'] . " "); - while ($user = $this->registry->db->fetch_array($userinfo)) + while ($userInfo = $this->registry->db->fetch_array($userinfo)) { - if (!is_array($this->users["$user[userid]"])) + if (!is_array($this->users["$userInfo[userid]"])) { $user = construct_user_display($this->registry->userinfo, false); $product = $this->registry->datastore['product']["$bug[product]"]['title'] . '/' . ($bug['component'] ? $this->registry->datastore['product']["$bug[component]"]['title'] . '/' : '') . $this->registry->datastore['version']["$bug[version]"]['version']; - $this->notices["$user[userid]"][] = eval('$email = "' . $this->registry->template->fetch('email/notice_new_bug.part') . '";'); - $this->users["$user[userid]"] = $user; - unset($this->users["$user[userid]"]['mask'], $this->users["$user[userid]"]['relation']); + $this->notices["$userInfo[userid]"][] = eval('$email = "' . $this->registry->template->fetch('email/notice_new_bug.part') . '";'); + $this->users["$userInfo[userid]"] = $userInfo; + unset($this->users["$userInfo[userid]"]['mask'], $this->users["$userInfo[userid]"]['relation']); } - $this->users["$user[userid]"]['options']["$user[relation]"] = $user['mask']; + $this->users["$userInfo[userid]"]['options']["$userInfo[relation]"] = $userInfo['mask']; } } -- 2.43.5