]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/User.php
Merge branch '0.7.x' of git@gitorious.org:laconica/dev into 0.7.x
[quix0rs-gnu-social.git] / classes / User.php
index 495a982360e04c716a2a52708d4f8ff87c197283..8b0b9acd506f3fb07ea7b0dfa43f355c1609ab93 100644 (file)
@@ -183,16 +183,16 @@ class User extends Memcached_DataObject
         $profile->nickname = $nickname;
         $profile->profileurl = common_profile_url($nickname);
 
-        if ($fullname) {
+        if (!empty($fullname)) {
             $profile->fullname = $fullname;
         }
-        if ($homepage) {
+        if (!empty($homepage)) {
             $profile->homepage = $homepage;
         }
-        if ($bio) {
+        if (!empty($bio)) {
             $profile->bio = $bio;
         }
-        if ($location) {
+        if (!empty($location)) {
             $profile->location = $location;
         }
 
@@ -200,7 +200,7 @@ class User extends Memcached_DataObject
 
         $id = $profile->insert();
 
-        if (!$id) {
+        if (empty($id)) {
             common_log_db_error($profile, 'INSERT', __FILE__);
             return false;
         }
@@ -210,13 +210,13 @@ class User extends Memcached_DataObject
         $user->id = $id;
         $user->nickname = $nickname;
 
-        if ($password) { # may not have a password for OpenID users
+        if (!empty($password)) { # may not have a password for OpenID users
             $user->password = common_munge_password($password, $id);
         }
 
         # Users who respond to invite email have proven their ownership of that address
 
-        if ($code) {
+        if (!empty($code)) {
             $invite = Invitation::staticGet($code);
             if ($invite && $invite->address && $invite->address_type == 'email' && $invite->address == $email) {
                 $user->email = $invite->address;
@@ -253,7 +253,7 @@ class User extends Memcached_DataObject
             return false;
         }
 
-        if ($email && !$user->email) {
+        if (!empty($email) && !$user->email) {
 
             $confirm = new Confirm_address();
             $confirm->code = common_confirmation_code(128);
@@ -268,7 +268,7 @@ class User extends Memcached_DataObject
             }
         }
 
-        if ($code && $user->email) {
+        if (!empty($code) && $user->email) {
             $user->emailChanged();
         }
 
@@ -589,7 +589,7 @@ class User extends Memcached_DataObject
           'JOIN profile_tag ON (profile_tag.tagged = subscription.subscriber ' .
           'AND profile_tag.tagger = subscription.subscribed) ' .
           'WHERE subscription.subscribed = %d ' .
-          'AND profile_tag.tag = "%s" ' .
+          "AND profile_tag.tag = '%s' " .
           'AND subscription.subscribed != subscription.subscriber ' .
           'ORDER BY subscription.created DESC ';
 
@@ -617,7 +617,7 @@ class User extends Memcached_DataObject
           'JOIN profile_tag on (profile_tag.tagged = subscription.subscribed ' .
           'AND profile_tag.tagger = subscription.subscriber) ' .
           'WHERE subscription.subscriber = %d ' .
-          'AND profile_tag.tag = "%s" ' .
+          "AND profile_tag.tag = '%s' " .
           'AND subscription.subscribed != subscription.subscriber ' .
           'ORDER BY subscription.created DESC ';