Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2680773
D25186.1734623128.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
1 KB
Referenced Files
None
Subscribers
None
D25186.1734623128.diff
View Options
diff --git a/src/applications/files/controller/PhabricatorFileViewController.php b/src/applications/files/controller/PhabricatorFileViewController.php
--- a/src/applications/files/controller/PhabricatorFileViewController.php
+++ b/src/applications/files/controller/PhabricatorFileViewController.php
@@ -311,7 +311,7 @@
$file->getStorageHandle());
$custom_alt = $file->getCustomAltText();
- if (strlen($custom_alt)) {
+ if (phutil_nonempty_string($custom_alt)) {
$finfo->addProperty(pht('Custom Alt Text'), $custom_alt);
}
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
@@ -60,12 +60,12 @@
}
$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/files/storage/PhabricatorFile.php b/src/applications/files/storage/PhabricatorFile.php
--- a/src/applications/files/storage/PhabricatorFile.php
+++ b/src/applications/files/storage/PhabricatorFile.php
@@ -1278,7 +1278,7 @@
public function getAltText() {
$alt = $this->getCustomAltText();
- if (strlen($alt)) {
+ if (phutil_nonempty_string($alt)) {
return $alt;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 19, 15:45 (22 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1015142
Default Alt Text
D25186.1734623128.diff (1 KB)
Attached To
Mode
D25186: Fix PHP 8.1 "strlen(null)" exceptions which block rendering page of a File
Attached
Detach File
Event Timeline
Log In to Comment