1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 16:22:43 +01:00

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
This commit is contained in:
Aviv Eyal 2024-02-23 17:05:48 +02:00
parent 7d8c84a7bd
commit 8667ed45fa

View file

@ -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" <link>. Otherwise, we'll just render: <link>.
$is_interesting_name = (bool)strlen($name);
$is_interesting_name = phutil_nonempty_string($name);
$target = idx($document_map, $key, null);