From: Raimond Spekking Date: Thu, 29 Nov 2007 07:01:30 +0000 (+0000) Subject: Cleanup for r27897: X-Git-Tag: 1.31.0-rc.0~50674 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=8c9e4381586b9b554f2e8ada2632a1b5eed421c1;p=lhc%2Fweb%2Fwiklou.git Cleanup for r27897: * Title::getBaseText is misleading as this function returns the subpage of a subsubpage instead of the root page (maybe my fault by misinterpreting "Get the base name, i.e. the leftmost parts before the /" * Fixes an issue for the (rare?) case that subpages are disabled for user (talk) namespace --- diff --git a/includes/EditPage.php b/includes/EditPage.php index 45c4ad9543..c7d94452c3 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -628,11 +628,13 @@ class EditPage { # Show a warning message when someone creates/edits a user (talk) page but the user does not exists if( $this->mTitle->getNamespace() == NS_USER || $this->mTitle->getNamespace() == NS_USER_TALK ) { - $id = User::idFromName( $this->mTitle->getBaseText() ); - $ip = User::isIP( $this->mTitle->getBaseText() ); + $parts = explode( '/', $this->mTitle->getText(), 2 ); + $username = $parts[0]; + $id = User::idFromName( $username ); + $ip = User::isIP( $username ); if ( $id == 0 && !$ip ) { - $wgOut->addWikiText( '
' . wfMsg( 'userpage-userdoesnotexist', $this->mTitle->getBaseText() ) . '
' ); + $wgOut->addWikiText( '
' . wfMsg( 'userpage-userdoesnotexist', $username ) . '
' ); } }