Fixed registering through Google Plus
authorAlexander Ebert <ebert@woltlab.com>
Wed, 31 Jul 2013 20:30:08 +0000 (22:30 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 31 Jul 2013 20:30:08 +0000 (22:30 +0200)
wcfsetup/install/files/lib/form/RegisterForm.class.php

index 3a7eb411f9a153f29bc68c52cd64f7b7281e729b..3ac4af4c1af899222b0666e18f85b1546bdd6fb1 100644 (file)
@@ -366,15 +366,17 @@ class RegisterForm extends UserAddForm {
                                        $registerVia3rdParty = true;
                                }
                                
-                               switch ($googleData['gender']) {
-                                       case 'male':
-                                               $saveOptions[User::getUserOptionID('gender')] = UserProfile::GENDER_MALE;
-                                       break;
-                                       case 'female':
-                                               $saveOptions[User::getUserOptionID('gender')] = UserProfile::GENDER_FEMALE;
-                                       break;
+                               if (isset($googleData['gender'])) {
+                                       switch ($googleData['gender']) {
+                                               case 'male':
+                                                       $saveOptions[User::getUserOptionID('gender')] = UserProfile::GENDER_MALE;
+                                               break;
+                                               case 'female':
+                                                       $saveOptions[User::getUserOptionID('gender')] = UserProfile::GENDER_FEMALE;
+                                               break;
+                                       }
                                }
-                               if (isset($facebookData['birthday'])) $saveOptions[User::getUserOptionID('birthday')] = $googleData['birthday'];
+                               if (isset($googleData['birthday'])) $saveOptions[User::getUserOptionID('birthday')] = $googleData['birthday'];
                        }
                        
                        // create fake password