Differential D25219 Diff 786 src/applications/settings/panel/PhabricatorMultiFactorSettingsPanel.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/settings/panel/PhabricatorMultiFactorSettingsPanel.php
Show First 20 Lines • Show All 251 Lines • ▼ Show 20 Lines | private function processNew(AphrontRequest $request) { | ||||
} | } | ||||
// NOTE: Beyond providing guidance, this step is also providing a CSRF gate | // NOTE: Beyond providing guidance, this step is also providing a CSRF gate | ||||
// on this endpoint, since prompting the user to respond to a challenge | // on this endpoint, since prompting the user to respond to a challenge | ||||
// sometimes requires us to push a challenge to them as a side effect (for | // sometimes requires us to push a challenge to them as a side effect (for | ||||
// example, with SMS). | // example, with SMS). | ||||
if (!$request->isFormPost() || !$request->getBool('mfa.start')) { | if (!$request->isFormPost() || !$request->getBool('mfa.start')) { | ||||
$enroll = $selected_provider->getEnrollMessage(); | $enroll = $selected_provider->getEnrollMessage(); | ||||
if (!strlen($enroll)) { | if (!phutil_nonempty_string($enroll)) { | ||||
valerio.bozzolan: ✅ I verified the above line that is similar to D25218
The function `phutil_nonempty_string()`… | |||||
$enroll = $selected_provider->getEnrollDescription($viewer); | $enroll = $selected_provider->getEnrollDescription($viewer); | ||||
} | } | ||||
return $this->newDialog() | return $this->newDialog() | ||||
->addHiddenInput('providerPHID', $selected_provider->getPHID()) | ->addHiddenInput('providerPHID', $selected_provider->getPHID()) | ||||
->addHiddenInput('mfa.start', 1) | ->addHiddenInput('mfa.start', 1) | ||||
->setTitle(pht('Add Authentication Factor')) | ->setTitle(pht('Add Authentication Factor')) | ||||
->appendChild(new PHUIRemarkupView($viewer, $enroll)) | ->appendChild(new PHUIRemarkupView($viewer, $enroll)) | ||||
▲ Show 20 Lines • Show All 200 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
✅ I verified the above line that is similar to D25218
The function phutil_nonempty_string() will report alien types, and that is OK.