&$attribs: the attributes to be applied.
$linkType: The external link type
+'LinkerMakeMediaLinkFile': At the end of Linker::makeMediaLinkFile() just
+before the return.
+$title: the Title object that the link is pointing to
+$file: the File object or false if broken link
+&$html: the link text
+&$attribs: the attributes to be applied
+&$ret: the value to return if your hook returns false
+
'LinksUpdate': At the beginning of LinksUpdate::doUpdate() just before the
actual update.
&$linksUpdate: the LinksUpdate object
$url = self::getUploadUrl( $title );
$class = 'new';
}
- $alt = htmlspecialchars( $title->getText(), ENT_QUOTES );
+
+ $alt = $title->getText();
if ( $html == '' ) {
$html = $alt;
}
- $u = htmlspecialchars( $url );
- return "<a href=\"{$u}\" class=\"$class\" title=\"{$alt}\">{$html}</a>";
+
+ $ret = '';
+ $attribs = array(
+ 'href' => $url,
+ 'class' => $class,
+ 'title' => $alt
+ );
+
+ if ( !wfRunHooks( 'LinkerMakeMediaLinkFile',
+ array( $title, $file, &$html, &$attribs, &$ret ) ) ) {
+ wfDebug( "Hook LinkerMakeMediaLinkFile changed the output of link with url {$url} and text {$html} to {$ret}\n", true );
+ return $ret;
+ }
+
+ return Html::rawElement( 'a', $attribs, $html );
}
/**