Page MenuHomePhorge

D25147.1737395004.diff
No OneTemporary

D25147.1737395004.diff

diff --git a/src/applications/files/controller/PhabricatorFileDataController.php b/src/applications/files/controller/PhabricatorFileDataController.php
--- a/src/applications/files/controller/PhabricatorFileDataController.php
+++ b/src/applications/files/controller/PhabricatorFileDataController.php
@@ -29,7 +29,7 @@
$request_kind = $request->getURIData('kind');
$is_download = ($request_kind === 'download');
- if (!strlen($alt) || $main_domain == $alt_domain) {
+ if (!phutil_nonempty_string($alt) || $main_domain == $alt_domain) {
// No alternate domain.
$should_redirect = false;
$is_alternate_domain = false;
diff --git a/src/applications/search/field/PhabricatorSearchDateField.php b/src/applications/search/field/PhabricatorSearchDateField.php
--- a/src/applications/search/field/PhabricatorSearchDateField.php
+++ b/src/applications/search/field/PhabricatorSearchDateField.php
@@ -17,7 +17,7 @@
}
protected function validateControlValue($value) {
- if (!strlen($value)) {
+ if (!phutil_nonempty_string($value)) {
return;
}
@@ -32,7 +32,7 @@
}
protected function parseDateTime($value) {
- if (!strlen($value)) {
+ if (!phutil_nonempty_string($value)) {
return null;
}
diff --git a/src/view/layout/AphrontSideNavFilterView.php b/src/view/layout/AphrontSideNavFilterView.php
--- a/src/view/layout/AphrontSideNavFilterView.php
+++ b/src/view/layout/AphrontSideNavFilterView.php
@@ -92,12 +92,21 @@
return $this->getMenuView()->getItem($key);
}
+ /**
+ * Add a thing in the menu
+ *
+ * @param string $key Internal name
+ * @param string $name Human name
+ * @param mixed $uri Destination URI. For example as string or as PhutilURI.
+ * @param string $type Item type. For example see PHUIListItemView constants.
+ * @param string $icon Icon name
+ */
private function addThing($key, $name, $uri, $type, $icon = null) {
$item = id(new PHUIListItemView())
->setName($name)
->setType($type);
- if (strlen($icon)) {
+ if (phutil_nonempty_string($icon)) {
$item->setIcon($icon);
}

File Metadata

Mime Type
text/plain
Expires
Mon, Jan 20, 17:43 (1 d, 13 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1133865
Default Alt Text
D25147.1737395004.diff (2 KB)

Event Timeline