Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/engine/PhabricatorApplicationSearchEngine.php
Show First 20 Lines • Show All 866 Lines • ▼ Show 20 Lines | protected function readListFromRequest( | ||||
} | } | ||||
return $list; | return $list; | ||||
} | } | ||||
protected function readBoolFromRequest( | protected function readBoolFromRequest( | ||||
AphrontRequest $request, | AphrontRequest $request, | ||||
$key) { | $key) { | ||||
if (!strlen($request->getStr($key))) { | if (!phutil_nonempty_string($request->getStr($key))) { | ||||
valerio.bozzolan: ✅ I tested `$request->getStr($key)` locally with `phlog()` and it seems it only assumes null or… | |||||
return null; | return null; | ||||
} | } | ||||
return $request->getBool($key); | return $request->getBool($key); | ||||
} | } | ||||
protected function getBoolFromQuery(PhabricatorSavedQuery $query, $key) { | protected function getBoolFromQuery(PhabricatorSavedQuery $query, $key) { | ||||
$value = $query->getParameter($key); | $value = $query->getParameter($key); | ||||
▲ Show 20 Lines • Show All 743 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 tested $request->getStr($key) locally with phlog() and it seems it only assumes null or the string "1". It should never assume the integer 1 to me, since the method getStr() is supposed to cast to string.
The phutil_nonempty_string() will report any alien type (like integers), and that is OK.