QA: Fixed bad update of user info when user_rank is NULL in Admin:UserManager
authorDan
Thu, 16 Apr 2009 12:19:07 -0400
changeset 928 e2971f4a3123
parent 927 e964577b5fa9
child 929 2e981507dfae
QA: Fixed bad update of user info when user_rank is NULL in Admin:UserManager
plugins/admin/UserManager.php
--- a/plugins/admin/UserManager.php	Thu Apr 16 00:55:13 2009 -0400
+++ b/plugins/admin/UserManager.php	Thu Apr 16 12:19:07 2009 -0400
@@ -356,8 +356,10 @@
           foreach ( $to_update_users as $key => $unused_crap )
           {
             $value =& $to_update_users[$key];
-            $value = $db->escape($value);
-            $update_sql .= ( empty($update_sql) ? '' : ',' ) . "$key='$value'";
+            if ( $value !== 'NULL' )
+              $value = "'" . $db->escape($value) . "'";
+ 
+            $update_sql .= ( empty($update_sql) ? '' : ',' ) . "$key=$value";
           }
           
           $update_sql = 'UPDATE '.table_prefix."users SET $update_sql WHERE user_id=$user_id;";