*/
public static function makeExternalLink( $url, $text, $escape = true, $linktype = '', $attribs = array() ) {
$class = "external";
- if ( isset($linktype) && $linktype ) {
+ if ( $linktype ) {
$class .= " $linktype";
}
- if ( isset($attribs['class']) && $attribs['class'] ) {
+ if ( isset( $attribs['class'] ) && $attribs['class'] ) {
$class .= " {$attribs['class']}";
}
$attribs['class'] = $class;
# Media link; trail not supported.
$linkRegexp = '/\[\[(.*?)\]\]/';
$title = Title::makeTitleSafe( NS_FILE, $submatch[1] );
- $thelink = self::makeMediaLinkObj( $title, $text );
+ if ( $title ) {
+ $thelink = self::makeMediaLinkObj( $title, $text );
+ }
} else {
# Other kind of link
if ( preg_match( $wgContLang->linkTrail(), $match[4], $submatch ) ) {
# bug 7425
$target = trim( $target );
# Look at the first character
- if ( $target != '' && $target { 0 } === '/' ) {
+ if ( $target != '' && $target[0] === '/' ) {
# / at end means we don't want the slash to be shown
$m = array();
$trailingSlashes = preg_match_all( '%(/+)$%', $target, $m );