Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2688946
D25179.1734725390.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
2 KB
Referenced Files
None
Subscribers
None
D25179.1734725390.diff
View Options
diff --git a/src/applications/project/typeahead/PhabricatorProjectDatasource.php b/src/applications/project/typeahead/PhabricatorProjectDatasource.php
--- a/src/applications/project/typeahead/PhabricatorProjectDatasource.php
+++ b/src/applications/project/typeahead/PhabricatorProjectDatasource.php
@@ -21,7 +21,9 @@
$raw_query = $this->getRawQuery();
// Allow users to type "#qa" or "qa" to find "Quality Assurance".
- $raw_query = ltrim($raw_query, '#');
+ if ($raw_query !== null) {
+ $raw_query = ltrim($raw_query, '#');
+ }
$tokens = self::tokenizeString($raw_query);
$query = id(new PhabricatorProjectQuery())
@@ -142,7 +144,7 @@
$proj_result->addAttribute($proj->getDisplayIconName());
$description = idx($descriptions, $phid);
- if (strlen($description)) {
+ if (phutil_nonempty_string($description)) {
$summary = PhabricatorMarkupEngine::summarizeSentence($description);
$proj_result->addAttribute($summary);
}
diff --git a/src/applications/typeahead/datasource/PhabricatorTypeaheadCompositeDatasource.php b/src/applications/typeahead/datasource/PhabricatorTypeaheadCompositeDatasource.php
--- a/src/applications/typeahead/datasource/PhabricatorTypeaheadCompositeDatasource.php
+++ b/src/applications/typeahead/datasource/PhabricatorTypeaheadCompositeDatasource.php
@@ -28,7 +28,7 @@
// We only need to do a prefix phase query if there's an actual query
// string. If the user didn't type anything, nothing can possibly match it.
- if (strlen($this->getRawQuery())) {
+ if (phutil_nonempty_string($this->getRawQuery())) {
$phases[] = self::PHASE_PREFIX;
}
diff --git a/src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php b/src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php
--- a/src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php
+++ b/src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php
@@ -464,7 +464,11 @@
// We're looking for a "(" so that a string like "members(q" is identified
// and parsed as a function call. This allows us to start generating
// results immediately, before the user fully types out "members(quack)".
- return (strpos($token, '(') !== false);
+ if ($token) {
+ return (strpos($token, '(') !== false);
+ } else {
+ return false;
+ }
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 20:09 (14 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1015345
Default Alt Text
D25179.1734725390.diff (2 KB)
Attached To
Mode
D25179: Fix PHP 8.1 null parameter exceptions which block rendering the "Browse Projects" overlay dialog
Attached
Detach File
Event Timeline
Log In to Comment