Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2697666
D25256.1734951626.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
5 KB
Referenced Files
None
Subscribers
None
D25256.1734951626.diff
View Options
diff --git a/src/applications/config/check/PhabricatorWebServerSetupCheck.php b/src/applications/config/check/PhabricatorWebServerSetupCheck.php
--- a/src/applications/config/check/PhabricatorWebServerSetupCheck.php
+++ b/src/applications/config/check/PhabricatorWebServerSetupCheck.php
@@ -23,7 +23,7 @@
}
$base_uri = PhabricatorEnv::getEnvConfig('phabricator.base-uri');
- if (!strlen($base_uri)) {
+ if (!phutil_nonempty_string($base_uri)) {
// If `phabricator.base-uri` is not set then we can't really do
// anything.
return;
diff --git a/src/applications/config/controller/services/PhabricatorConfigDatabaseStatusController.php b/src/applications/config/controller/services/PhabricatorConfigDatabaseStatusController.php
--- a/src/applications/config/controller/services/PhabricatorConfigDatabaseStatusController.php
+++ b/src/applications/config/controller/services/PhabricatorConfigDatabaseStatusController.php
@@ -837,7 +837,7 @@
$parts = array();
foreach ($properties as $key => $property) {
- if (!strlen($property)) {
+ if (!phutil_nonempty_string($property)) {
continue;
}
diff --git a/src/applications/diffusion/request/DiffusionGitRequest.php b/src/applications/diffusion/request/DiffusionGitRequest.php
--- a/src/applications/diffusion/request/DiffusionGitRequest.php
+++ b/src/applications/diffusion/request/DiffusionGitRequest.php
@@ -3,7 +3,7 @@
final class DiffusionGitRequest extends DiffusionRequest {
protected function isStableCommit($symbol) {
- return preg_match('/^[a-f0-9]{40}\z/', $symbol);
+ return $symbol && preg_match('/^[a-f0-9]{40}\z/', $symbol);
}
public function getBranch() {
diff --git a/src/applications/files/controller/PhabricatorFileLightboxController.php b/src/applications/files/controller/PhabricatorFileLightboxController.php
--- a/src/applications/files/controller/PhabricatorFileLightboxController.php
+++ b/src/applications/files/controller/PhabricatorFileLightboxController.php
@@ -20,7 +20,7 @@
return new Aphront404Response();
}
- if (strlen($comment)) {
+ if (phutil_nonempty_string($comment)) {
$xactions = array();
$xactions[] = id(new PhabricatorFileTransaction())
->setTransactionType(PhabricatorTransactions::TYPE_COMMENT)
diff --git a/src/applications/files/document/render/PhabricatorDocumentRenderingEngine.php b/src/applications/files/document/render/PhabricatorDocumentRenderingEngine.php
--- a/src/applications/files/document/render/PhabricatorDocumentRenderingEngine.php
+++ b/src/applications/files/document/render/PhabricatorDocumentRenderingEngine.php
@@ -208,12 +208,12 @@
$this->activeEngine = $engine;
$encode_setting = $request->getStr('encode');
- if (strlen($encode_setting)) {
+ if (phutil_nonempty_string($encode_setting)) {
$engine->setEncodingConfiguration($encode_setting);
}
$highlight_setting = $request->getStr('highlight');
- if (strlen($highlight_setting)) {
+ if (phutil_nonempty_string($highlight_setting)) {
$engine->setHighlightingConfiguration($highlight_setting);
}
diff --git a/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php b/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php
--- a/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php
+++ b/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php
@@ -74,7 +74,7 @@
$viewer = $this->getViewer();
$type = $args->getArg('type');
- if (!strlen($type)) {
+ if (!phutil_nonempty_string($type)) {
$type = PhabricatorMailEmailMessage::MESSAGETYPE;
}
diff --git a/src/applications/people/mail/PhabricatorPeopleEmailLoginMailEngine.php b/src/applications/people/mail/PhabricatorPeopleEmailLoginMailEngine.php
--- a/src/applications/people/mail/PhabricatorPeopleEmailLoginMailEngine.php
+++ b/src/applications/people/mail/PhabricatorPeopleEmailLoginMailEngine.php
@@ -64,7 +64,7 @@
$message_body = PhabricatorAuthMessage::loadMessageText(
$recipient,
$message_key);
- if (strlen($message_body)) {
+ if (phutil_nonempty_string($message_body)) {
$body[] = $this->newRemarkupText($message_body);
}
diff --git a/src/applications/repository/storage/PhabricatorRepository.php b/src/applications/repository/storage/PhabricatorRepository.php
--- a/src/applications/repository/storage/PhabricatorRepository.php
+++ b/src/applications/repository/storage/PhabricatorRepository.php
@@ -1160,7 +1160,7 @@
*/
public function getRemoteURIObject() {
$raw_uri = $this->getDetail('remote-uri');
- if (!strlen($raw_uri)) {
+ if (!phutil_nonempty_string($raw_uri)) {
return new PhutilURI('');
}
diff --git a/src/applications/repository/storage/PhabricatorRepositoryURI.php b/src/applications/repository/storage/PhabricatorRepositoryURI.php
--- a/src/applications/repository/storage/PhabricatorRepositoryURI.php
+++ b/src/applications/repository/storage/PhabricatorRepositoryURI.php
@@ -752,7 +752,7 @@
// without requiring an index rebuild.
$ssh_host = PhabricatorEnv::getEnvConfig('diffusion.ssh-host');
- if (strlen($ssh_host)) {
+ if (phutil_nonempty_string($ssh_host)) {
$domain_map['<ssh-host>'] = $ssh_host;
}
diff --git a/src/applications/search/controller/PhabricatorSearchController.php b/src/applications/search/controller/PhabricatorSearchController.php
--- a/src/applications/search/controller/PhabricatorSearchController.php
+++ b/src/applications/search/controller/PhabricatorSearchController.php
@@ -13,7 +13,7 @@
$viewer = $this->getViewer();
$query = $request->getStr('query');
- if ($request->getStr('jump') != 'no' && strlen($query)) {
+ if ($request->getStr('jump') != 'no' && phutil_nonempty_string($query)) {
$jump_uri = id(new PhabricatorDatasourceEngine())
->setViewer($viewer)
->newJumpURI($query);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 23, 11:00 (10 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1026917
Default Alt Text
D25256.1734951626.diff (5 KB)
Attached To
Mode
D25256: T15064: PHP8 related corrections
Attached
Detach File
Event Timeline
Log In to Comment