Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2692067
D25182.1734754317.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
D25182.1734754317.diff
View Options
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryManagePanelsController.php b/src/applications/diffusion/controller/DiffusionRepositoryManagePanelsController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryManagePanelsController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryManagePanelsController.php
@@ -40,7 +40,7 @@
}
$selected = $request->getURIData('panel');
- if (!strlen($selected)) {
+ if (!phutil_nonempty_string($selected)) {
$selected = head_key($panels);
}
diff --git a/src/applications/diffusion/controller/DiffusionServeController.php b/src/applications/diffusion/controller/DiffusionServeController.php
--- a/src/applications/diffusion/controller/DiffusionServeController.php
+++ b/src/applications/diffusion/controller/DiffusionServeController.php
@@ -43,8 +43,8 @@
return null;
}
- $content_type = $request->getHTTPHeader('Content-Type');
- $user_agent = idx($_SERVER, 'HTTP_USER_AGENT');
+ $content_type = $request->getHTTPHeader('Content-Type', '');
+ $user_agent = idx($_SERVER, 'HTTP_USER_AGENT', '');
$request_type = $request->getHTTPHeader('X-Phabricator-Request-Type');
// This may have a "charset" suffix, so only match the prefix.
diff --git a/src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php b/src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php
--- a/src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php
+++ b/src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php
@@ -219,7 +219,7 @@
$view->addProperty(pht('Type'), $type);
$callsign = $repository->getCallsign();
- if (!strlen($callsign)) {
+ if (!phutil_nonempty_string($callsign)) {
$callsign = phutil_tag('em', array(), pht('No Callsign'));
}
$view->addProperty(pht('Callsign'), $callsign);
diff --git a/src/applications/repository/editor/PhabricatorRepositoryEditor.php b/src/applications/repository/editor/PhabricatorRepositoryEditor.php
--- a/src/applications/repository/editor/PhabricatorRepositoryEditor.php
+++ b/src/applications/repository/editor/PhabricatorRepositoryEditor.php
@@ -50,7 +50,7 @@
// If the repository does not have a local path yet, assign it one based
// on its ID. We can't do this earlier because we won't have an ID yet.
$local_path = $object->getLocalPath();
- if (!strlen($local_path)) {
+ if (!phutil_nonempty_string($local_path)) {
$local_key = 'repository.default-local-path';
$local_root = PhabricatorEnv::getEnvConfig($local_key);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 21, 04:11 (17 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1022994
Default Alt Text
D25182.1734754317.diff (2 KB)
Attached To
Mode
D25182: Fix PHP 8.1 "strlen(null)" and "preg_match()" exceptions which block repository creation
Attached
Detach File
Event Timeline
Log In to Comment