Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F5488363
D26088.1750124200.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
D26088.1750124200.diff
View Options
diff --git a/src/future/exec/PhutilExecutableFuture.php b/src/future/exec/PhutilExecutableFuture.php
--- a/src/future/exec/PhutilExecutableFuture.php
+++ b/src/future/exec/PhutilExecutableFuture.php
@@ -143,7 +143,7 @@
foreach ($known_keys as $known_key) {
$value = getenv($known_key);
- if (strlen($value)) {
+ if ($value && $value !== '') {
$default_env[$known_key] = $value;
}
}
diff --git a/src/future/http/HTTPFuture.php b/src/future/http/HTTPFuture.php
--- a/src/future/http/HTTPFuture.php
+++ b/src/future/http/HTTPFuture.php
@@ -149,7 +149,8 @@
$this->stateWriteComplete = true;
}
- while (($data = fread($this->socket, 32768)) || strlen($data)) {
+ while (($data = fread($this->socket, 32768)) ||
+ ($data && $data !== '')) {
$this->response .= $data;
}
diff --git a/src/toolset/workflow/ArcanistShellCompleteWorkflow.php b/src/toolset/workflow/ArcanistShellCompleteWorkflow.php
--- a/src/toolset/workflow/ArcanistShellCompleteWorkflow.php
+++ b/src/toolset/workflow/ArcanistShellCompleteWorkflow.php
@@ -194,7 +194,7 @@
$file = $spec['file'];
$home = getenv('HOME');
- if (!strlen($home)) {
+ if (!$home || !phutil_nonempty_string($home)) {
throw new PhutilArgumentUsageException(
pht(
'The "HOME" environment variable is not defined, so this workflow '.
@@ -343,7 +343,7 @@
pht('Detecting current shell...'));
$shell_env = getenv('SHELL');
- if (!strlen($shell_env)) {
+ if (!$shell_env || !phutil_nonempty_string($shell_env)) {
$log->writeWarning(
pht('SHELL'),
pht(
diff --git a/src/workflow/ArcanistPatchWorkflow.php b/src/workflow/ArcanistPatchWorkflow.php
--- a/src/workflow/ArcanistPatchWorkflow.php
+++ b/src/workflow/ArcanistPatchWorkflow.php
@@ -366,7 +366,7 @@
case self::SOURCE_PATCH:
if ($param == '-') {
$patch = @file_get_contents('php://stdin');
- if (!strlen($patch)) {
+ if (!$patch || !phutil_nonempty_string($patch)) {
throw new ArcanistUsageException(
pht('Failed to read patch from stdin!'));
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jun 17, 01:36 (16 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1880512
Default Alt Text
D26088.1750124200.diff (2 KB)
Attached To
Mode
D26088: Improve passing false|null to some strlen() calls
Attached
Detach File
Event Timeline
Log In to Comment