Last modified: 2013-01-14 17:10:23 UTC
Code says: # Context links: [[|name]] and [[name (context)|]] $tc = '[' . Title::legalChars() . ']'; $nc = '[ _0-9A-Za-z\x80-\xff-]'; # Namespaces can use non-ascii! # ... omitted ... $t = $this->mTitle->getText(); $m = array(); if ( preg_match( "/^($nc+:|)$tc+?( \\($tc+\\))$/", $t, $m ) ) { $text = preg_replace( $p2, "[[$m[1]\\1$m[2]|\\1]]", $text ); } elseif ( preg_match( "/^($nc+:|)$tc+?(, $tc+|)$/", $t, $m ) && "$m[1]$m[2]" != '' ) { $text = preg_replace( $p2, "[[$m[1]\\1$m[2]|\\1]]", $text ); } else { # if there's no context, don't bother duplicating the title $text = preg_replace( $p2, '[[\\1]]', $text ); } In 'if' and 'elseif' line, regexes begins with ($nc+:|) so I guess the original author intended to include namespace name automatically, but $t = $this->mTitle->getText(); should be written as $t = $this->mTitle->getPrefixedText(); in this case.