r1472: Fix a string offset bug due to those annoying uses of construct_user_display...
authorRobert Sesek <rsesek@bluestatic.org>
Sat, 17 Mar 2007 18:36:36 +0000 (18:36 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Sat, 17 Mar 2007 18:36:36 +0000 (18:36 +0000)
docs/changes.txt
includes/class_notification.php

index 0b772a5872c6c6468f56040a425b56a4ac02ce33..f53e3991ba0537d49407b5255844092e05e64ed1 100644 (file)
@@ -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
 ===============================
index 567afb468fa084243e75efe695f5567e69daee27..1d4184c796018a2a18f273e62318c4f171718759 100644 (file)
@@ -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'];
                }
        }