# # Patch for MediaWiki to enable the magic identifiers in Wiki. # --- mediawiki-1.11.0-orig/includes/Parser.php +++ mediawiki-1.11.0/includes/Parser.php @@ -1080,7 +1080,10 @@ class Parser (?: 97[89] [\ \-]? )? # optional 13-digit ISBN prefix (?: [0-9] [\ \-]? ){9} # 9 digits with opt. delimiters [0-9Xx] # check digit - \b) + \b) | + BugID:\s+([0-9]+) | # BugID magic identifier as m[3] + VCS:\s+([0-9A-Za-z_/\-.]*\b) | # VCS magic identifier as m[4] + Wiki:\s+([A-Za-z_\-:]+) # Wiki magic identifier as m[5] )!x', array( &$this, 'magicLinkCallback' ), $text ); wfProfileOut( __METHOD__ ); return $text; @@ -1110,6 +1113,18 @@ class Parser $keyword = 'PMID'; $urlmsg = 'pubmedurl'; $id = $m[1]; + } elseif ( substr( $m[0], 0, 6 ) == 'BugID:' ) { + $keyword = 'BugID:'; + $urlmsg = 'bugurl'; + $id = $m[3]; + } elseif ( substr( $m[0], 0, 4 ) == 'VCS:' ) { + $keyword = 'VCS:'; + $urlmsg = 'vcsurl'; + $id = $m[4]; + } elseif ( substr( $m[0], 0, 5 ) == 'Wiki:' ) { + $keyword = 'Wiki:'; + $urlmsg = 'wikiurl'; + $id = $m[5]; } else { throw new MWException( __METHOD__.': unrecognised match type "' . substr($m[0], 0, 20 ) . '"' ); --- mediawiki-1.11.0-orig/languages/messages/MessagesEn.php +++ mediawiki-1.11.0/languages/messages/MessagesEn.php @@ -1669,6 +1669,9 @@ further information about books you are 'userrights-summary' => '', # only translate this message to other languages if you have to change it 'groups' => 'User groups', 'isbn' => 'ISBN', # only translate this message to other languages if you have to change it +'bugurl' => '/bugzilla/show_bug.cgi?id=$1', +'vcsurl' => '/cgi-bin/viewvc.cgi/$1/', +'wikiurl' => '/wiki/index.php/$1', 'rfcurl' => 'http://tools.ietf.org/html/rfc$1', # don't translate or duplicate this message to other languages 'pubmedurl' => 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=$1', # don't translate or duplicate this message to other languages 'alphaindexline' => '$1 to $2',