Florianschmidtwelzow has uploaded a new change for review.
https://gerrit.wikimedia.org/r/263063
Change subject: Fix false inclusion of FULLPAGENAME on Special:MobileDiff
......................................................................
Fix false inclusion of FULLPAGENAME on Special:MobileDiff
Bug: T122984
Change-Id: I04c8ddeafa9b30648def69f96210c4a72bbc26db
---
M includes/diff/InlineDifferenceEngine.php
1 file changed, 19 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/63/263063/1
diff --git a/includes/diff/InlineDifferenceEngine.php
b/includes/diff/InlineDifferenceEngine.php
index b101347..01054f9 100644
--- a/includes/diff/InlineDifferenceEngine.php
+++ b/includes/diff/InlineDifferenceEngine.php
@@ -77,15 +77,30 @@
$allowed = $this->isUserAllowedToSee();
$suppressed = $this->isSuppressedDiff();
+ // This IContextSource object will be used to get a
message object for the
+ // messages used in this function. We need to to this
to allow the message to
+ // get the correct value for the FULLPAGENAME inclusion
(which is used in
+ // rev-suppressed-no-diff, e.g.). Otherwise it would
use Special:MobileDiff as
+ // the target for
Special:Log/delete?page=Special:MobileDiff/..., which isn't
+ // correct and very helpful. To fix this bug, we create
a new context from the
+ // current one and set the title object (which we can
get from the new revision).
+ // Bug: T122984
+ $context = new DerivativeContext( $this->getContext() );
+ $revision = $this->mNewRev;
+ $context->setTitle( $revision->getTitle() );
+
if ( !$allowed ) {
- $msg = $suppressed ? 'rev-suppressed-no-diff' :
'rev-deleted-no-diff';
- $msg = wfMessage( $msg )->parse();
+ $msg = $context->msg(
+ $suppressed ? 'rev-suppressed-no-diff'
: 'rev-deleted-no-diff'
+ )->parse();
} else {
# Give explanation and add a link to view the
diff...
$query = $this->getRequest()->appendQueryValue(
'unhide', '1', true );
$link = $this->getTitle()->getFullURL( $query );
- $msg = $suppressed ?
'rev-suppressed-unhide-diff' : 'rev-deleted-unhide-diff';
- $msg = wfMessage( $msg, $link )->parse();
+ $msg = $context->msg(
+ $suppressed ?
'rev-suppressed-unhide-diff' : 'rev-deleted-unhide-diff',
+ $link
+ )->parse();
}
}
return $msg;
--
To view, visit https://gerrit.wikimedia.org/r/263063
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I04c8ddeafa9b30648def69f96210c4a72bbc26db
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits