From: Rob Church Date: Thu, 25 May 2006 08:22:32 +0000 (+0000) Subject: (bug 6062) Logic error in {{BASEPAGENAME}} X-Git-Tag: 1.31.0-rc.0~57042 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22brouteur%22%2C%28%24id_rubrique%20?a=commitdiff_plain;h=d4c121cb573497ba6f465a0bc7215239a4e2e26f;p=lhc%2Fweb%2Fwiklou.git (bug 6062) Logic error in {{BASEPAGENAME}} --- diff --git a/includes/Title.php b/includes/Title.php index b8769a2fab..1e87fd8a8d 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -697,9 +697,11 @@ class Title { */ function getBaseText() { global $wgNamespacesWithSubpages; - if( isset( $wgNamespacesWithSubpages[ $this->mNamespace] ) && $wgNamespacesWithSubpages[ $this->mNamespace ] ) { + if( isset( $wgNamespacesWithSubpages[ $this->mNamespace ] ) && $wgNamespacesWithSubpages[ $this->mNamespace ] ) { $parts = explode( '/', $this->getText() ); - unset( $parts[ count( $parts ) - 1 ] ); + # Don't discard the real title if there's no subpage involved + if( count( $parts ) > 1 ) + unset( $parts[ count( $parts ) - 1 ] ); return implode( '/', $parts ); } else { return $this->getText();