Fixed broken user website
authorMarcel Werk <burntime@woltlab.com>
Thu, 9 Jan 2014 21:46:17 +0000 (22:46 +0100)
committerMarcel Werk <burntime@woltlab.com>
Thu, 9 Jan 2014 21:46:17 +0000 (22:46 +0100)
wcfsetup/install/files/lib/form/RegisterForm.class.php

index 4e5b28738410e2505a2407a80c84283245226916..3538ffeff0e2e2918b3db64e199c4ac5daa7605f 100644 (file)
@@ -346,11 +346,14 @@ class RegisterForm extends UserAddForm {
                                                if (isset($facebookData['bio'])) $saveOptions[User::getUserOptionID('aboutMe')] = $facebookData['bio'];
                                                if (isset($facebookData['location'])) $saveOptions[User::getUserOptionID('location')] = $facebookData['location']['name'];
                                                if (isset($facebookData['website'])) {
-                                                       if (!Regex::compile('^https?://')->match($facebookData['website'])) {
-                                                               $facebookData['website'] = 'http://' . $facebookData['website'];
+                                                       $urls = preg_split('/[\s,;]/', $facebookData['website'], -1, PREG_SPLIT_NO_EMPTY);
+                                                       if (!empty($urls)) {
+                                                               if (!Regex::compile('^https?://')->match($urls[0])) {
+                                                                       $urls[0] = 'http://' . $urls[0];
+                                                               }
+                                                               
+                                                               $saveOptions[User::getUserOptionID('homepage')] = $urls[0];
                                                        }
-                                                       
-                                                       $saveOptions[User::getUserOptionID('homepage')] = $facebookData['website'];
                                                }
                                                
                                                // avatar
@@ -424,15 +427,6 @@ class RegisterForm extends UserAddForm {
                $user = $result['returnValues'];
                $userEditor = new UserEditor($user);
                
-               // update user rank
-               if (MODULE_USER_RANK && !REGISTER_ACTIVATION_METHOD) {
-                       $action = new UserProfileAction(array($userEditor), 'updateUserRank');
-                       $action->executeAction();
-               }
-               // update user online marking
-               $action = new UserProfileAction(array($userEditor), 'updateUserOnlineMarking');
-               $action->executeAction();
-               
                // set avatar if provided
                if (!empty($avatarURL)) {
                        $userAvatarAction = new UserAvatarAction(array(), 'fetchRemoteAvatar', array(