diff --git a/src/applications/auth/controller/PhabricatorLoginValidateController.php b/src/applications/auth/controller/PhabricatorLoginValidateController.php index e8b3de5045..492b47cf5f 100644 --- a/src/applications/auth/controller/PhabricatorLoginValidateController.php +++ b/src/applications/auth/controller/PhabricatorLoginValidateController.php @@ -1,92 +1,92 @@ getRequest(); $failures = array(); - if (!$request->getStr('phusr')) { + if (!strlen($request->getStr('phusr'))) { throw new Exception( "Login validation is missing expected parameters!"); } $expect_phusr = $request->getStr('phusr'); $actual_phusr = $request->getCookie('phusr'); if ($actual_phusr != $expect_phusr) { if ($actual_phusr) { $cookie_info = "sent back a cookie with the value '{$actual_phusr}'."; } else { $cookie_info = "did not accept the cookie."; } $failures[] = "Attempted to set 'phusr' cookie to '{$expect_phusr}', but your ". "browser {$cookie_info}"; } if (!$failures) { if (!$request->getUser()->getPHID()) { $failures[] = "Cookies were set correctly, but your session ". "isn't valid."; } } if ($failures) { $list = array(); foreach ($failures as $failure) { $list[] = '
  • '.phutil_escape_html($failure).'
  • '; } $list = ''; $view = new AphrontRequestFailureView(); $view->setHeader('Login Failed'); $view->appendChild( '

    Login failed:

    '. $list. '

    Clear your cookies and try again.

    '); $view->appendChild( '
    '. 'Try Again'. '
    '); return $this->buildStandardPageResponse( $view, array( 'title' => 'Login Failed', )); } $next = nonempty($request->getStr('next'), $request->getCookie('next_uri')); $request->clearCookie('next_uri'); if (!PhabricatorEnv::isValidLocalWebResource($next)) { $next = '/'; } return id(new AphrontRedirectResponse())->setURI($next); } }