Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2942369
D25182.1738117128.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.1738117128.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,7 +43,11 @@
return null;
}
- $content_type = $request->getHTTPHeader('Content-Type');
+ if ($request->getHTTPHeader('Content-Type')) {
+ $content_type = $request->getHTTPHeader('Content-Type');
+ } else {
+ $content_type = '';
+ }
$user_agent = idx($_SERVER, 'HTTP_USER_AGENT');
$request_type = $request->getHTTPHeader('X-Phabricator-Request-Type');
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
Wed, Jan 29, 02:18 (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1146776
Default Alt Text
D25182.1738117128.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