Differential D12680 Diff 30510 src/applications/help/controller/PhabricatorHelpKeyboardShortcutController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/help/controller/PhabricatorHelpKeyboardShortcutController.php
<?php | <?php | ||||
final class PhabricatorHelpKeyboardShortcutController | final class PhabricatorHelpKeyboardShortcutController | ||||
extends PhabricatorHelpController { | extends PhabricatorHelpController { | ||||
public function shouldAllowPublic() { | public function shouldAllowPublic() { | ||||
return true; | return true; | ||||
} | } | ||||
public function processRequest() { | public function processRequest() { | ||||
$request = $this->getRequest(); | $request = $this->getRequest(); | ||||
$user = $request->getUser(); | $user = $request->getUser(); | ||||
$keys = $request->getStr('keys'); | $keys = $request->getStr('keys'); | ||||
$keys = json_decode($keys, true); | try { | ||||
if (!is_array($keys)) { | $keys = phutil_json_decode($keys); | ||||
} catch (PhutilJSONParserException $ex) { | |||||
return new Aphront400Response(); | return new Aphront400Response(); | ||||
} | } | ||||
// There have been at least two users asking for a keyboard shortcut to | // There have been at least two users asking for a keyboard shortcut to | ||||
// close the dialog, so be explicit that escape works since it isn't | // close the dialog, so be explicit that escape works since it isn't | ||||
// terribly discoverable. | // terribly discoverable. | ||||
$keys[] = array( | $keys[] = array( | ||||
'keys' => array('esc'), | 'keys' => array('esc'), | ||||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |