Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14077665
D21752.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D21752.diff
View Options
diff --git a/src/applications/herald/storage/transcript/HeraldTranscript.php b/src/applications/herald/storage/transcript/HeraldTranscript.php
--- a/src/applications/herald/storage/transcript/HeraldTranscript.php
+++ b/src/applications/herald/storage/transcript/HeraldTranscript.php
@@ -66,6 +66,10 @@
}
private static function combineXHeraldRulesHeaders($u, $v) {
+ if ($u === null) {
+ return $v;
+ }
+
$u = preg_split('/[, ]+/', $u);
$v = preg_split('/[, ]+/', $v);
diff --git a/src/applications/project/__tests__/PhabricatorProjectCoreTestCase.php b/src/applications/project/__tests__/PhabricatorProjectCoreTestCase.php
--- a/src/applications/project/__tests__/PhabricatorProjectCoreTestCase.php
+++ b/src/applications/project/__tests__/PhabricatorProjectCoreTestCase.php
@@ -1435,7 +1435,7 @@
$task = ManiphestTask::initializeNewTask($viewer);
- if (!strlen($name)) {
+ if ($name === null || $name === '') {
$name = pht('Test Task');
}
diff --git a/src/applications/project/storage/PhabricatorProject.php b/src/applications/project/storage/PhabricatorProject.php
--- a/src/applications/project/storage/PhabricatorProject.php
+++ b/src/applications/project/storage/PhabricatorProject.php
@@ -407,11 +407,13 @@
$this->setMailKey(Filesystem::readRandomCharacters(20));
}
- if (!strlen($this->getPHID())) {
+ $phid = $this->getPHID();
+ if ($phid === null || $phid === '') {
$this->setPHID($this->generatePHID());
}
- if (!strlen($this->getProjectPathKey())) {
+ $path_key = $this->getProjectPathKey();
+ if ($path_key === null || $path_key === '') {
$hash = PhabricatorHash::digestForIndex($this->getPHID());
$hash = substr($hash, 0, 4);
$this->setProjectPathKey($hash);
diff --git a/src/applications/transactions/editengine/PhabricatorEditEngine.php b/src/applications/transactions/editengine/PhabricatorEditEngine.php
--- a/src/applications/transactions/editengine/PhabricatorEditEngine.php
+++ b/src/applications/transactions/editengine/PhabricatorEditEngine.php
@@ -474,7 +474,9 @@
->setIsDefault(true)
->setIsEdit(true);
- if (!strlen($first->getName())) {
+ $first_name = $first->getName();
+
+ if ($first_name === null || $first_name === '') {
$first->setName($this->getObjectCreateShortText());
}
} else {
diff --git a/src/applications/transactions/storage/PhabricatorEditEngineConfiguration.php b/src/applications/transactions/storage/PhabricatorEditEngineConfiguration.php
--- a/src/applications/transactions/storage/PhabricatorEditEngineConfiguration.php
+++ b/src/applications/transactions/storage/PhabricatorEditEngineConfiguration.php
@@ -185,7 +185,7 @@
$fields = $this->reorderFields($fields);
$preamble = $this->getPreamble();
- if (strlen($preamble)) {
+ if ($preamble !== null && strlen($preamble)) {
$fields = array(
'config.preamble' => id(new PhabricatorInstructionsEditField())
->setKey('config.preamble')
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 12:49 AM (8 h, 13 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6776473
Default Alt Text
D21752.diff (3 KB)
Attached To
Mode
D21752: Fix a PHP 8.1 unit test failure in Projects
Attached
Detach File
Event Timeline
Log In to Comment