Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/engine/PhabricatorProfileMenuEngine.php
Show First 20 Lines • Show All 1,302 Lines • ▼ Show 20 Lines | private function selectViewItem( | ||||
PhabricatorProfileMenuItemViewList $view_list, | PhabricatorProfileMenuItemViewList $view_list, | ||||
$item_id) { | $item_id) { | ||||
// Figure out which view's content we're going to render. In most cases, | // Figure out which view's content we're going to render. In most cases, | ||||
// the URI tells us. If we don't have an identifier in the URI, we'll | // the URI tells us. If we don't have an identifier in the URI, we'll | ||||
// render the default view instead. | // render the default view instead. | ||||
$selected_view = null; | $selected_view = null; | ||||
if (strlen($item_id)) { | if (phutil_nonempty_string($item_id)) { | ||||
valerio.bozzolan: 👀 This should be double-checked
Sometime Phabricator handles IDs as integers and - if this… | |||||
Done Inline ActionsIt seems to me that $item_id comes from buildResponse() from the same class, from this line: $item_id = $request->getURIData('itemID'); So: public function getURIData($key, $default = null) { return idx($this->uriData, $key, $default); } And the uriData comes for example from: $request->setURIMap( array( 'id' => head($must_sign_docs)->getID(), )); At this point I can 99.9999% say that ID is just a string. If a related problem will be raised, we can surly adopt instead phutil_nonempty_scalar in the future. valerio.bozzolan: It seems to me that `$item_id` comes from `buildResponse()` from the same class, from this line… | |||||
$item_views = $view_list->getViewsWithItemIdentifier($item_id); | $item_views = $view_list->getViewsWithItemIdentifier($item_id); | ||||
if ($item_views) { | if ($item_views) { | ||||
$selected_view = head($item_views); | $selected_view = head($item_views); | ||||
} | } | ||||
} else { | } else { | ||||
$default_views = $view_list->getDefaultViews(); | $default_views = $view_list->getDefaultViews(); | ||||
if ($default_views) { | if ($default_views) { | ||||
$selected_view = head($default_views); | $selected_view = head($default_views); | ||||
▲ Show 20 Lines • Show All 42 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
👀 This should be double-checked
Sometime Phabricator handles IDs as integers and - if this happens here - phutil will throw.