next to the user name and ID.
* (bug 8392) Display protection status of transcluded pages in the edit page
template list. Patch by Fyren, with i18n naming tweak.
+* Fix for interwiki transclusion where target wiki uses query string for title
+* Resolve namespaces on interwiki Title objects using canonical namespace names
+ if possible (should not happen, though, outside interwiki transclusion... and
+ maybe not even then, but it does)
== Languages updated ==
* Transclude an interwiki link.
*/
function interwikiTransclude( $title, $action ) {
- global $wgEnableScaryTranscluding, $wgCanonicalNamespaceNames;
+ global $wgEnableScaryTranscluding;
if (!$wgEnableScaryTranscluding)
return wfMsg('scarytranscludedisabled');
- // The namespace will actually only be 0 or 10, depending on whether there was a leading :
- // But we'll handle it generally anyway
- if ( $title->getNamespace() ) {
- // Use the canonical namespace, which should work anywhere
- $articleName = $wgCanonicalNamespaceNames[$title->getNamespace()] . ':' . $title->getDBkey();
- } else {
- $articleName = $title->getDBkey();
- }
-
- $url = str_replace('$1', urlencode($articleName), Title::getInterwikiLink($title->getInterwiki()));
- $url .= "?action=$action";
+ $url = $title->getFullUrl( "action=$action" );
+
if (strlen($url) > 255)
return wfMsg('scarytranscludetoolong');
return $this->fetchScaryTemplateMaybeFromCache($url);
* @access public
*/
function getNsText() {
- global $wgContLang;
+ global $wgContLang, $wgCanonicalNamespaceNames;
+
+ if ( '' != $this->mInterwiki ) {
+ // This probably shouldn't even happen. ohh man, oh yuck.
+ // But for interwiki transclusion it sometimes does.
+ // Shit. Shit shit shit.
+ //
+ // Use the canonical namespaces if possible to try to
+ // resolve a foreign namespace.
+ if( isset( $wgCanonicalNamespaceNames[$this->mNamespace] ) ) {
+ return $wgCanonicalNamespaceNames[$this->mNamespace];
+ }
+ }
return $wgContLang->getNsText( $this->mNamespace );
}
/**
} else {
$baseUrl = $this->getInterwikiLink( $this->mInterwiki );
- $namespace = $wgContLang->getNsText( $this->mNamespace );
+ $namespace = wfUrlencode( $this->getNsText() );
if ( '' != $namespace ) {
# Can this actually happen? Interwikis shouldn't be parsed.
+ # Yes! It can in interwiki transclusion. But... it probably shouldn't.
$namespace .= ':';
}
$url = str_replace( '$1', $namespace . $this->mUrlform, $baseUrl );
* @private
*/
/* private */ function prefix( $name ) {
- global $wgContLang;
-
$p = '';
if ( '' != $this->mInterwiki ) {
$p = $this->mInterwiki . ':';
}
if ( 0 != $this->mNamespace ) {
- $p .= $wgContLang->getNsText( $this->mNamespace ) . ':';
+ $p .= $this->getNsText() . ':';
}
return $p . $name;
}