From 8c9e4381586b9b554f2e8ada2632a1b5eed421c1 Mon Sep 17 00:00:00 2001 From: Raimond Spekking Date: Thu, 29 Nov 2007 07:01:30 +0000 Subject: [PATCH] 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 --- includes/EditPage.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 ) . '
' ); } } -- 2.20.1