* @param string|null $wikiId Id of the wiki to link to (if not the local wiki),
* as used by WikiMap.
*
- * @return string
+ * @return string HTML
+ * @return-taint onlysafefor_html
*/
public static function formatLinksInComment(
$comment, $title = null, $local = false, $wikiId = null
return preg_replace_callback(
'/
\[\[
+ \s*+ # ignore leading whitespace, the *+ quantifier disallows backtracking
:? # ignore optional leading colon
([^\]|]+) # 1. link target; page names cannot include ] or |
(?:\|