diff options
author | Mario <mario@mariovavti.com> | 2024-03-07 10:00:02 +0100 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-03-07 10:00:02 +0100 |
commit | 6262d351b777443bee2a1b5b534082268ebe72f9 (patch) | |
tree | 4eb6d2b7f4677f76a3c392552691b8726d75522b /Zotlabs/Lib/Activity.php | |
parent | 27e57ff7aad9b70a4d088b880fac4af2920fdd31 (diff) | |
download | volse-hubzilla-6262d351b777443bee2a1b5b534082268ebe72f9.tar.gz volse-hubzilla-6262d351b777443bee2a1b5b534082268ebe72f9.tar.bz2 volse-hubzilla-6262d351b777443bee2a1b5b534082268ebe72f9.zip |
fix deprecation warning and add test
Diffstat (limited to 'Zotlabs/Lib/Activity.php')
-rw-r--r-- | Zotlabs/Lib/Activity.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 4c89e22bd..3af6253f9 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -3282,17 +3282,18 @@ class Activity { return $content; } - static function get_textfield($act, $field) { + static function get_textfield($act, $field): null|string|array { + $content = null; - $content = false; - - if (array_key_exists($field, $act) && $act[$field]) + if (array_key_exists($field, $act) && $act[$field]) { $content = purify_html($act[$field]); + } elseif (array_key_exists($field . 'Map', $act) && $act[$field . 'Map']) { foreach ($act[$field . 'Map'] as $k => $v) { $content[escape_tags($k)] = purify_html($v); } } + return $content; } |