Changeset View
Changeset View
Standalone View
Standalone View
src/applications/meta/query/PhabricatorAppSearchEngine.php
Show All 39 Lines | final class PhabricatorAppSearchEngine | ||||
} | } | ||||
public function buildQueryFromSavedQuery(PhabricatorSavedQuery $saved) { | public function buildQueryFromSavedQuery(PhabricatorSavedQuery $saved) { | ||||
$query = id(new PhabricatorApplicationQuery()) | $query = id(new PhabricatorApplicationQuery()) | ||||
->setOrder(PhabricatorApplicationQuery::ORDER_NAME) | ->setOrder(PhabricatorApplicationQuery::ORDER_NAME) | ||||
->withUnlisted(false); | ->withUnlisted(false); | ||||
$name = $saved->getParameter('name'); | $name = $saved->getParameter('name'); | ||||
if (strlen($name)) { | if (phutil_nonempty_string($name)) { | ||||
valerio.bozzolan: ✅ I logged `$name` locally with `phlog()` in various page and I can confirm we can assume it as… | |||||
$query->withNameContains($name); | $query->withNameContains($name); | ||||
} | } | ||||
$installed = $saved->getParameter('installed'); | $installed = $saved->getParameter('installed'); | ||||
if ($installed !== null) { | if ($installed !== null) { | ||||
$query->withInstalled($installed); | $query->withInstalled($installed); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 220 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 logged $name locally with phlog() in various page and I can confirm we can assume it as string or null. It assumes string values like "Test test" or "" if you use the Name Contains field with these values.
The phutil_nonempty_string() will report alien values and this is OK.