diff --git a/src/applications/files/controller/PhabricatorFileViewController.php b/src/applications/files/controller/PhabricatorFileViewController.php index 389fc66247..2dea0a51ce 100644 --- a/src/applications/files/controller/PhabricatorFileViewController.php +++ b/src/applications/files/controller/PhabricatorFileViewController.php @@ -311,7 +311,7 @@ final class PhabricatorFileViewController extends PhabricatorFileController { $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 index 5a4cb77340..f43689bbba 100644 --- a/src/applications/files/document/render/PhabricatorDocumentRenderingEngine.php +++ b/src/applications/files/document/render/PhabricatorDocumentRenderingEngine.php @@ -60,12 +60,12 @@ abstract class PhabricatorDocumentRenderingEngine } $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 index 355aa2d215..44e35c6b72 100644 --- a/src/applications/files/storage/PhabricatorFile.php +++ b/src/applications/files/storage/PhabricatorFile.php @@ -1278,7 +1278,7 @@ final class PhabricatorFile extends PhabricatorFileDAO public function getAltText() { $alt = $this->getCustomAltText(); - if (strlen($alt)) { + if (phutil_nonempty_string($alt)) { return $alt; }