Skip to content

Commit 729b59a

Browse files
committed
fix: Allow sanitizeHTML to accept null
Used like this in many places Signed-off-by: Carl Schwan <[email protected]>
1 parent e0e77d5 commit 729b59a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/public/Util.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,11 +459,11 @@ public static function callRegister() {
459459
* This function is used to sanitize HTML and should be applied on any
460460
* string or array of strings before displaying it on a web page.
461461
*
462-
* @param string|string[] $value
462+
* @param string|string[]|null $value
463463
* @return ($value is array ? string[] : string) an array of sanitized strings or a single sanitized string, depends on the input parameter.
464464
* @since 4.5.0
465465
*/
466-
public static function sanitizeHTML(string|array $value): string|array {
466+
public static function sanitizeHTML(string|array|null $value): string|array {
467467
if (is_array($value)) {
468468
return array_map(function (string $value): string {
469469
return htmlspecialchars((string)$value, ENT_QUOTES, 'UTF-8');

0 commit comments

Comments
 (0)