Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2709702
D25268.1735311595.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
3 KB
Referenced Files
None
Subscribers
None
D25268.1735311595.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D25268: Fix PHP 8.2 "strlen(null)" exceptions block rendering Differential Revision page (T15432 - 1/2)
Attached
Detach File
Event Timeline
Log In to Comment