Differential D25171 Diff 614 src/applications/config/controller/settings/PhabricatorConfigSettingsListController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/controller/settings/PhabricatorConfigSettingsListController.php
<?php | <?php | ||||
final class PhabricatorConfigSettingsListController | final class PhabricatorConfigSettingsListController | ||||
extends PhabricatorConfigSettingsController { | extends PhabricatorConfigSettingsController { | ||||
public function handleRequest(AphrontRequest $request) { | public function handleRequest(AphrontRequest $request) { | ||||
$viewer = $request->getViewer(); | $viewer = $request->getViewer(); | ||||
$filter = $request->getURIData('filter'); | $filter = $request->getURIData('filter'); | ||||
if (!strlen($filter)) { | if (!phutil_nonempty_string($filter)) { | ||||
valerio.bozzolan: ✅ I tracked `$filter` with `phlog()` and it assumes values like `"advanced"` or `"all"` or null… | |||||
$filter = 'settings'; | $filter = 'settings'; | ||||
} | } | ||||
$is_core = ($filter === 'settings'); | $is_core = ($filter === 'settings'); | ||||
$is_advanced = ($filter === 'advanced'); | $is_advanced = ($filter === 'advanced'); | ||||
$is_all = ($filter === 'all'); | $is_all = ($filter === 'all'); | ||||
$show_core = ($is_core || $is_all); | $show_core = ($is_core || $is_all); | ||||
▲ Show 20 Lines • Show All 89 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 tracked $filter with phlog() and it assumes values like "advanced" or "all" or null and it's not indented to assume other types. You can have a proof of that also looking at the below lines.
The function phutil_nonempty_string() will report alien types, and that is OK.