From de97e3388deaa56ba4f60a6ecae66f67d6e9e46e Mon Sep 17 00:00:00 2001 From: Peter Burnett Date: Fri, 15 Sep 2023 11:01:02 +1000 Subject: [PATCH] Remove null call to htmlspecialchars --- locallib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/locallib.php b/locallib.php index 14fc57e..89c5437 100644 --- a/locallib.php +++ b/locallib.php @@ -45,6 +45,10 @@ * @return string HTML snippet which can be used in output. */ function tool_crawler_link($url, $label, $redirect = '', $labelishtml = false) { + if (empty($label)) { + // Ensure that label is always at least a string. + $label = ''; + } if (!$labelishtml) { $label = htmlspecialchars($label, ENT_NOQUOTES | ENT_HTML401); }