Fix GitHub primary email not correctly being detected
authorNiklas (Krymonota) <Krymonota@users.noreply.github.com>
Thu, 6 Feb 2020 17:01:13 +0000 (18:01 +0100)
committerNiklas (Krymonota) <Krymonota@users.noreply.github.com>
Thu, 6 Feb 2020 17:01:13 +0000 (18:01 +0100)
wcfsetup/install/files/lib/action/GithubAuthAction.class.php

index 123e427bb7378955442bf5a44b393524c007511c..d7285a24237785fc5e1a3fe4a9d6f595ac43bbb3 100644 (file)
@@ -129,8 +129,10 @@ class GithubAuthAction extends AbstractAction {
                                                // search primary email
                                                $email = $emails[0]['email'];
                                                foreach ($emails as $tmp) {
-                                                       if ($tmp['primary']) $email = $tmp['email'];
-                                                       break;
+                                                       if ($tmp['primary']) {
+                                                               $email = $tmp['email'];
+                                                               break;
+                                                       }
                                                }
                                                WCF::getSession()->register('__email', $email);
                                        }