Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/controller/PhabricatorAuthRegisterController.php
Show All 12 Lines | public function handleRequest(AphrontRequest $request) { | ||||
if ($viewer->isLoggedIn()) { | if ($viewer->isLoggedIn()) { | ||||
return id(new AphrontRedirectResponse())->setURI('/'); | return id(new AphrontRedirectResponse())->setURI('/'); | ||||
} | } | ||||
$invite = $this->loadInvite(); | $invite = $this->loadInvite(); | ||||
$is_setup = false; | $is_setup = false; | ||||
if (strlen($account_key)) { | if (phutil_nonempty_string($account_key)) { | ||||
valerio.bozzolan: ✅ The input value is probably safe to be assumed as `string` or NULL since it comes from… | |||||
$result = $this->loadAccountForRegistrationOrLinking($account_key); | $result = $this->loadAccountForRegistrationOrLinking($account_key); | ||||
list($account, $provider, $response) = $result; | list($account, $provider, $response) = $result; | ||||
$is_default = false; | $is_default = false; | ||||
} else if ($this->isFirstTimeSetup()) { | } else if ($this->isFirstTimeSetup()) { | ||||
$account = null; | $account = null; | ||||
$provider = null; | $provider = null; | ||||
$response = null; | $response = null; | ||||
$is_default = true; | $is_default = true; | ||||
▲ Show 20 Lines • Show All 209 Lines • ▼ Show 20 Lines | public function handleRequest(AphrontRequest $request) { | ||||
$value_username = $default_username; | $value_username = $default_username; | ||||
$value_realname = $default_realname; | $value_realname = $default_realname; | ||||
$value_email = $default_email; | $value_email = $default_email; | ||||
$value_password = null; | $value_password = null; | ||||
$require_real_name = PhabricatorEnv::getEnvConfig('user.require-real-name'); | $require_real_name = PhabricatorEnv::getEnvConfig('user.require-real-name'); | ||||
$e_username = strlen($value_username) ? null : true; | $e_username = phutil_nonempty_string($value_username) ? null : true; | ||||
Done Inline Actions✅ It's OK to assume a username as string or as NULL (default). Alien values will be reported and this is OK. valerio.bozzolan: ✅ It's OK to assume a username as string or as NULL (default). Alien values will be reported… | |||||
$e_realname = $require_real_name ? true : null; | $e_realname = $require_real_name ? true : null; | ||||
$e_email = strlen($value_email) ? null : true; | $e_email = phutil_nonempty_string($value_email) ? null : true; | ||||
Done Inline Actions✅ It's really OK to assume a username as string or as NULL (default). Alien values will be reported and this is OK. valerio.bozzolan: ✅ It's really OK to assume a username as string or as NULL (default). Alien values will be… | |||||
$e_password = true; | $e_password = true; | ||||
$e_captcha = true; | $e_captcha = true; | ||||
$skip_captcha = false; | $skip_captcha = false; | ||||
if ($invite) { | if ($invite) { | ||||
// If the user is accepting an invite, assume they're trustworthy enough | // If the user is accepting an invite, assume they're trustworthy enough | ||||
// that we don't need to CAPTCHA them. | // that we don't need to CAPTCHA them. | ||||
$skip_captcha = true; | $skip_captcha = true; | ||||
▲ Show 20 Lines • Show All 501 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0
✅ The input value is probably safe to be assumed as string or NULL since it comes from $request->getURIData('akey')