From 4859706745f21e4abbf312ebbaf7511c3e015652 Mon Sep 17 00:00:00 2001 From: John Du Hart Date: Thu, 1 Sep 2011 03:56:33 +0000 Subject: [PATCH] (bug 5865) Warning on editing other user's userpage --- RELEASE-NOTES-1.19 | 1 + includes/EditPage.php | 11 +++++++++++ languages/messages/MessagesEn.php | 2 ++ 3 files changed, 14 insertions(+) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 872738b065..805b98099c 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -51,6 +51,7 @@ production. * (bug 30344) Add configuration variable for setting custom priorities when generating sitemaps * (bug 16428) Include permalink in printable version +* (bug 5865) Warning on editing other user's userpage === Bug fixes in 1.19 === * $wgUploadNavigationUrl should be used for file redlinks if diff --git a/includes/EditPage.php b/includes/EditPage.php index 90434a47d3..a0bafa7c34 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1605,6 +1605,17 @@ HTML } } + $curUP = $wgUser->getUserPage(); + $sk = $wgOut->getSkin(); + if ( $this->mTitle->getNamespace() == NS_USER + && substr( $this->mTitle->getPrefixedText(), 0, strlen( $curUP->getPrefixedText() ) ) != $curUP->getPrefixedText() + && $this->formtype != 'preview' + && $this->formtype != 'diff' ) + { + $utpLink = $sk->makeKnownLinkObj( $this->mTitle->getTalkPage(), wfMsgHtml( 'editinguserpagetalklink' ), 'action=edit' ); + $wgOut->addHTML( wfMsgWikiHtml( 'editinguserpage', $utpLink ) ); + } + if ( wfReadOnly() ) { $wgOut->wrapWikiMsg( "
\n$1\n
", array( 'readonlywarning', wfReadOnlyReason() ) ); } elseif ( $wgUser->isAnon() ) { diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 98b37122f9..cafa477adf 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1437,6 +1437,8 @@ It appears to have been deleted.', 'edit-no-change' => 'Your edit was ignored, because no change was made to the text.', 'edit-already-exists' => 'Could not create a new page. It already exists.', +'editinguserpage' => "'''Note:''' You are editing a [[Help:User page|user page]]. To leave this user a message, $1.", +'editinguserpagetalklink' => 'edit their talk page', 'addsection-preload' => '', # do not translate or duplicate this message to other languages 'addsection-editintro' => '', # do not translate or duplicate this message to other languages -- 2.20.1