if ( substr( $m[0], 0, 3 ) === 'RFC' ) {
$keyword = 'RFC';
$urlmsg = 'rfcurl';
- $CssClass = 'mw-magiclink-rfc';
+ $cssClass = 'mw-magiclink-rfc';
$id = $m[4];
} elseif ( substr( $m[0], 0, 4 ) === 'PMID' ) {
$keyword = 'PMID';
$urlmsg = 'pubmedurl';
- $CssClass = 'mw-magiclink-pmid';
+ $cssClass = 'mw-magiclink-pmid';
$id = $m[4];
} else {
throw new MWException( __METHOD__ . ': unrecognised match type "' .
substr( $m[0], 0, 20 ) . '"' );
}
$url = wfMessage( $urlmsg, $id )->inContentLanguage()->text();
- return Linker::makeExternalLink( $url, "{$keyword} {$id}", true, $CssClass );
+ return Linker::makeExternalLink( $url, "{$keyword} {$id}", true, $cssClass );
} elseif ( isset( $m[5] ) && $m[5] !== '' ) {
# ISBN
$isbn = $m[5];
wfProfileOut( __METHOD__ );
return $s;
}
+
/**
* Get the rel attribute for a particular external link.
*
}
return null;
}
+
/**
* Get an associative array of additional HTML attributes appropriate for a
* particular external link. This currently may include rel => nofollow
* Add a tracking category, getting the title from a system message,
* or print a debug message if the title is invalid.
*
+ * Please add any message that you use with this function to
+ * $wgTrackingCategories. That way they will be listed on
+ * Special:TrackingCategories.
+ *
* @param string $msg message key
* @return Boolean: whether the addition was successful
*/
/**
* Pre-save transform helper function
- * @private
*
* @param $text string
* @param $user User
*
* @return string
*/
- function pstPass2( $text, $user ) {
+ private function pstPass2( $text, $user ) {
global $wgContLang;
# Note: This is the timestamp saved as hardcoded wikitext to
# Strip external link markup
# @todo FIXME: Not tolerant to blank link text
- # I.E. [http://www.mediawiki.org] will render as [1] or something depending
+ # I.E. [https://www.mediawiki.org] will render as [1] or something depending
# on how many empty links there are on the page - need to figure that out.
$text = preg_replace( '/\[(?i:' . $this->mUrlProtocols . ')([^ ]+?) ([^[]+)\]/', '$2', $text );