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); }