]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
strcmp for comparison
authorEvan Prodromou <evan@controlezvous.ca>
Sun, 22 Jun 2008 15:32:20 +0000 (11:32 -0400)
committerEvan Prodromou <evan@controlezvous.ca>
Sun, 22 Jun 2008 15:32:20 +0000 (11:32 -0400)
darcs-hash:20080622153220-34904-119cea6c5dbe20e33569287cf9632c07e9768b10.gz

actions/profilesettings.php
classes/User.php

index 30dbd89ecf0463f57c24431b0497417d4a7b5f1b..b23a43f8700e877af329dd635f3b34c10c801d5e 100644 (file)
@@ -114,21 +114,23 @@ class ProfilesettingsAction extends SettingsAction {
 
                $user->query('BEGIN');
 
-               $original = clone($user);
+               if (strcmp($user->nickname, $nickname) != 0) {
+                       $original = clone($user);
                
-               $user->nickname = $nickname;
+                       $user->nickname = $nickname;
 
-               common_debug('Old nickname = ' . $original->nickname . ', new nickname = ' . $user->nickname, __FILE__);
+                       common_debug('Old nickname = ' . $original->nickname . ', new nickname = ' . $user->nickname, __FILE__);
                
-               $result = $user->updateKeys($original);
+                       $result = $user->updateKeys($original);
                
-               if ($result === FALSE) {
-                       common_log_db_error($user, 'UPDATE', __FILE__);
-                       common_server_error(_t('Couldnt update user.'));
-                       return;
+                       if ($result === FALSE) {
+                               common_log_db_error($user, 'UPDATE', __FILE__);
+                               common_server_error(_t('Couldnt update user.'));
+                               return;
+                       }
                }
 
-               if ($user->email != $email) {
+               if (strcmp($user->email, $email) != 0) {
                        
                        # We don't update email directly; it gets done by confirmemail
                        
index 94240392ed33438543a5b4990dc0ac6ccdeb071a..4fb6892ea45d32bfd93d9652f84dd0e0078601b4 100644 (file)
@@ -67,7 +67,7 @@ class User extends DB_DataObject
        function updateKeys(&$orig) {
                $parts = array();
                foreach (array('nickname', 'email') as $k) {
-                       if ($this->$k != $orig->$k) {
+                       if (strcmp($this->$k, $orig->$k) != 0) {
                                $parts[] = $k . ' = ' . $this->_quote($this->$k);
                        }
                }