From: Brion Vibber <brion@pobox.com>
Date: Thu, 18 Mar 2010 16:22:08 +0000 (-0700)
Subject: Ensure that DB connection is active at start of User::updateKeys() and Foreign_user... 
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=515cdf28a83eda5cc82f0c423099a36c0168dbb6;p=quix0rs-gnu-social.git

Ensure that DB connection is active at start of User::updateKeys() and Foreign_user::updateKeys(); calls to $this->_quote() require a live connection object and don't lazy-initialize themselves.
May fix WSOD when changing incoming email address.
---

diff --git a/classes/Foreign_user.php b/classes/Foreign_user.php
index 8b3e03dfb3..0dd94ffb99 100644
--- a/classes/Foreign_user.php
+++ b/classes/Foreign_user.php
@@ -41,6 +41,7 @@ class Foreign_user extends Memcached_DataObject
 
     function updateKeys(&$orig)
     {
+        $this->_connect();
         $parts = array();
         foreach (array('id', 'service', 'uri', 'nickname') as $k) {
             if (strcmp($this->$k, $orig->$k) != 0) {
diff --git a/classes/User.php b/classes/User.php
index 13f63010f7..0b25b71a03 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -91,6 +91,7 @@ class User extends Memcached_DataObject
 
     function updateKeys(&$orig)
     {
+        $this->_connect();
         $parts = array();
         foreach (array('nickname', 'email', 'jabber', 'incomingemail', 'sms', 'carrier', 'smsemail', 'language', 'timezone') as $k) {
             if (strcmp($this->$k, $orig->$k) != 0) {