From 8667ed45fada1fe39100144d4c4a52a12d78e7de Mon Sep 17 00:00:00 2001 From: Aviv Eyal Date: Fri, 23 Feb 2024 17:05:48 +0200 Subject: [PATCH] Fix an instance of `strlen(null)` Summary: Ref Q112, ref T15064. Test Plan: Enter the text `[[hello]]` in a remarkup field - without this change, it causes a deprecation warning in the log. This doesn't happen if the content looks like a valid URL - this is the "Wiki Link" syntax. Reviewers: bekay, O1 Blessed Committers, valerio.bozzolan Reviewed By: O1 Blessed Committers, valerio.bozzolan Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T15064 Differential Revision: https://we.phorge.it/D25539 --- src/applications/phriction/markup/PhrictionRemarkupRule.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applications/phriction/markup/PhrictionRemarkupRule.php b/src/applications/phriction/markup/PhrictionRemarkupRule.php index 8394b23218..0ea6e07d09 100644 --- a/src/applications/phriction/markup/PhrictionRemarkupRule.php +++ b/src/applications/phriction/markup/PhrictionRemarkupRule.php @@ -191,7 +191,7 @@ final class PhrictionRemarkupRule extends PhutilRemarkupRule { // If the name is something meaningful to humans, we'll render this // in text as: "Title" . Otherwise, we'll just render: . - $is_interesting_name = (bool)strlen($name); + $is_interesting_name = phutil_nonempty_string($name); $target = idx($document_map, $key, null);