Page MenuHomePhorge

D25268.1735311595.diff
No OneTemporary

D25268.1735311595.diff

diff --git a/src/applications/conduit/controller/PhabricatorConduitAPIController.php b/src/applications/conduit/controller/PhabricatorConduitAPIController.php
--- a/src/applications/conduit/controller/PhabricatorConduitAPIController.php
+++ b/src/applications/conduit/controller/PhabricatorConduitAPIController.php
@@ -683,7 +683,7 @@
// Otherwise, look for a single parameter called 'params' which has the
// entire param dictionary JSON encoded.
$params_json = $request->getStr('params');
- if (strlen($params_json)) {
+ if (phutil_nonempty_string($params_json)) {
$params = null;
try {
$params = phutil_json_decode($params_json);
diff --git a/src/applications/differential/customfield/DifferentialBranchField.php b/src/applications/differential/customfield/DifferentialBranchField.php
--- a/src/applications/differential/customfield/DifferentialBranchField.php
+++ b/src/applications/differential/customfield/DifferentialBranchField.php
@@ -36,8 +36,8 @@
}
private function getBranchDescription(DifferentialDiff $diff) {
- $branch = $diff->getBranch();
- $bookmark = $diff->getBookmark();
+ $branch = coalesce($diff->getBranch(), '');
+ $bookmark = coalesce($diff->getBookmark(), '');
if (strlen($branch) && strlen($bookmark)) {
return pht('%s (bookmark) on %s (branch)', $bookmark, $branch);
diff --git a/src/applications/differential/editor/DifferentialTransactionEditor.php b/src/applications/differential/editor/DifferentialTransactionEditor.php
--- a/src/applications/differential/editor/DifferentialTransactionEditor.php
+++ b/src/applications/differential/editor/DifferentialTransactionEditor.php
@@ -218,7 +218,7 @@
// No "$", to allow for branches like T123_demo.
$match = null;
- if (preg_match('/^T(\d+)/i', $branch, $match)) {
+ if ($branch !== null && preg_match('/^T(\d+)/i', $branch, $match)) {
$task_id = $match[1];
$tasks = id(new ManiphestTaskQuery())
->setViewer($this->getActor())
diff --git a/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php b/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php
--- a/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php
+++ b/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php
@@ -252,6 +252,7 @@
$this->getUser(),
array(
'action' => '/D'.$revision_id.'#toc',
+ 'method' => 'GET',
),
array(
$table,
diff --git a/src/infrastructure/diff/view/PHUIDiffTableOfContentsItemView.php b/src/infrastructure/diff/view/PHUIDiffTableOfContentsItemView.php
--- a/src/infrastructure/diff/view/PHUIDiffTableOfContentsItemView.php
+++ b/src/infrastructure/diff/view/PHUIDiffTableOfContentsItemView.php
@@ -139,7 +139,7 @@
$not_applicable = '-';
$coverage = $this->getCoverage();
- if (!strlen($coverage)) {
+ if (!phutil_nonempty_string($coverage)) {
return $not_applicable;
}
@@ -157,7 +157,7 @@
$not_applicable = '-';
$coverage = $this->getCoverage();
- if (!strlen($coverage)) {
+ if (!phutil_nonempty_string($coverage)) {
return $not_applicable;
}
diff --git a/src/infrastructure/editor/PhabricatorEditorURIEngine.php b/src/infrastructure/editor/PhabricatorEditorURIEngine.php
--- a/src/infrastructure/editor/PhabricatorEditorURIEngine.php
+++ b/src/infrastructure/editor/PhabricatorEditorURIEngine.php
@@ -16,7 +16,7 @@
$pattern = $viewer->getUserSetting(PhabricatorEditorSetting::SETTINGKEY);
- if (!strlen(trim($pattern))) {
+ if ($pattern === null || !strlen(trim($pattern))) {
return null;
}

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 27, 14:59 (8 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1035008
Default Alt Text
D25268.1735311595.diff (3 KB)

Event Timeline