Differential D25214 Diff 718 src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php
Show First 20 Lines • Show All 2,443 Lines • ▼ Show 20 Lines | |||||
/* -( Ngrams )------------------------------------------------------------- */ | /* -( Ngrams )------------------------------------------------------------- */ | ||||
protected function withNgramsConstraint( | protected function withNgramsConstraint( | ||||
PhabricatorSearchNgrams $index, | PhabricatorSearchNgrams $index, | ||||
$value) { | $value) { | ||||
if (strlen($value)) { | if (phutil_nonempty_string($value)) { | ||||
valerio.bozzolan: ✅ I verified the above line
The `$value` contains the search string, or null.
The function… | |||||
$this->ngrams[] = array( | $this->ngrams[] = array( | ||||
'index' => $index, | 'index' => $index, | ||||
'value' => $value, | 'value' => $value, | ||||
'length' => count(phutil_utf8v($value)), | 'length' => count(phutil_utf8v($value)), | ||||
); | ); | ||||
} | } | ||||
return $this; | return $this; | ||||
▲ Show 20 Lines • Show All 823 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 verified the above line
The $value contains the search string, or null.
The function phutil_nonempty_string() is designed to report alien types like objects, and that is good here.