$s = $thumb->toHtml( $params );
}
if ( $frameParams['align'] != '' ) {
- $s = "<div class=\"float{$frameParams['align']}\">{$s}</div>";
+ $s = Html::rawElement(
+ 'div',
+ [ 'class' => 'float' . $frameParams['align'] ],
+ $s
+ );
}
return str_replace( "\n", ' ', $prefix . $s . $postfix );
}
* @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 |
(?:\|