Skip to content

Commit ba947ae

Browse files
committed
Use htmlspecialchars when parsing a URL see #7564.
1 parent d74d700 commit ba947ae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

main/inc/lib/display.lib.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,8 @@ public static function tag($tag, $content, $additional_attributes = array())
832832
public static function url($name, $url, $extra_attributes = array())
833833
{
834834
if (!empty($url)) {
835-
$extra_attributes['href']= $url;
835+
$url = htmlspecialchars($url, ENT_QUOTES, 'UTF-8');
836+
$extra_attributes['href'] = $url;
836837
}
837838
return self::tag('a', $name, $extra_attributes);
838839
}

0 commit comments

Comments
 (0)