Differential D25158 Diff 576 src/applications/config/controller/module/PhabricatorConfigModuleController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/controller/module/PhabricatorConfigModuleController.php
<?php | <?php | ||||
final class PhabricatorConfigModuleController | final class PhabricatorConfigModuleController | ||||
extends PhabricatorConfigController { | extends PhabricatorConfigController { | ||||
public function handleRequest(AphrontRequest $request) { | public function handleRequest(AphrontRequest $request) { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$key = $request->getURIData('module'); | $key = $request->getURIData('module'); | ||||
$all_modules = PhabricatorConfigModule::getAllModules(); | $all_modules = PhabricatorConfigModule::getAllModules(); | ||||
if (!strlen($key)) { | if (!phutil_nonempty_string($key)) { | ||||
valerio.bozzolan: ✅ The `$key` is NULL as default for the page `/config/module/` - and it's a string like… | |||||
$key = head_key($all_modules); | $key = head_key($all_modules); | ||||
} | } | ||||
if (empty($all_modules[$key])) { | if (empty($all_modules[$key])) { | ||||
return new Aphront404Response(); | return new Aphront404Response(); | ||||
} | } | ||||
$module = $all_modules[$key]; | $module = $all_modules[$key]; | ||||
▲ Show 20 Lines • Show All 43 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 $key is NULL as default for the page /config/module/ - and it's a string like "hovercardengine" for the page /config/module/hovercardengine/ etc. so it's the valid domain for phutil_nonempty_string().
Alien values will be reported and that is OK.