"yo" => "http://yo.wikipedia.com/wiki.cgi?$1",
"za" => "http://za.wikipedia.com/wiki.cgi?$1",
"zh" => "http://zh.wikipedia.org/wiki/$1",
+ "zh-cn" => "http://zh.wikipedia.org/wiki/$1",
+ "zh-tw" => "http://zh.wikipedia.org/wiki/$1",
"zu" => "http://zu.wikipedia.com/wiki.cgi?$1",
"nds" => "http://nds.wikipedia.org/wiki.cgi?$1"
);
$link = $m[1];
}
- if ( preg_match( "/^([A-Za-z\\x80-\\xff]+):(.*)\$/", $link, $m ) ) {
+ if ( preg_match( "/^((?:i|x|[a-z]{2,3})(?:-[a-z0-9]+)?|[A-Za-z\\x80-\\xff]+):(.*)\$/", $link, $m ) ) {
$pre = strtolower( $m[1] );
$suf = $m[2];
if ( $wgLang->getNsIndex( $pre ) ==
return "-,.()' &;%!?_0-9A-Za-z\\/:\\x80-\\xFF";
} else {
# ISO 8859-* don't allow 0x80-0x9F
- return "-,.()' &;%!?_0-9A-Za-z\\/:\\xA0-\\xFF";
+ #return "-,.()' &;%!?_0-9A-Za-z\\/:\\xA0-\\xFF";
+ # But that breaks interlanguage links at the moment. Temporary:
+ return "-,.()' &;%!?_0-9A-Za-z\\/:\\x80-\\xFF";
}
}
if ( ":" == $t{0} ) {
$r = substr( $t, 1 );
} else {
- if ( preg_match( "/^([A-Za-z0-9_\\x80-\\xff]+):(.*)$/", $t, $m ) ) {
+ if ( preg_match( "/^((?:i|x|[a-z]{2,3})(?:-[a-z0-9]+)?|[A-Za-z0-9_\\x80-\\xff]+):(.*)$/", $t, $m ) ) {
#$p = strtolower( $m[1] );
$p = $m[1];
if ( array_key_exists( $p, $wgValidInterwikis ) ) {
"yo" => "Yoruba",
"za" => "Zhuang",
"zh" => "中文 (Zhongwen)",
+ "zh-cn" => "中文(简体) (Simplified Chinese)",
+ "zh-tw" => "中文(繁体) (Traditional Chinese)",
"zu" => "Zulu"
);