mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Thanks
synced 2024-11-15 10:59:42 +00:00
BeforeSpecialMobileDiffDisplay hook: Only accept RevisionRecord
Compatibility was added so that MobileFrontend could switch from
Revision to RevisionRecord, but now that the switch has occurred no
need to keep checking to see if a Revision is being passed
See [1] for the MobileFrontend change that required compatibility
[1] e42c52527b
Bug: T246284
Change-Id: Ie320454a0e90d7f98004a3b776010aff784bbf4d
This commit is contained in:
parent
895bb0b99d
commit
4d18a1e093
|
@ -266,15 +266,12 @@ class ThanksHooks {
|
|||
* Add thanks button to SpecialMobileDiff page
|
||||
* @param OutputPage &$output OutputPage object
|
||||
* @param MobileContext $ctx MobileContext object
|
||||
* @param array $revisions Array of the two revisions that are being compared in the diff
|
||||
* @param array $revisions Array with two elements, either nulls or RevisionRecord objects for
|
||||
* the two revisions that are being compared in the diff
|
||||
*/
|
||||
public static function onBeforeSpecialMobileDiffDisplay( &$output, $ctx, $revisions ) {
|
||||
$rev = $revisions[1];
|
||||
|
||||
if ( $rev && $rev instanceof Revision ) {
|
||||
$rev = $rev->getRevisionRecord();
|
||||
}
|
||||
|
||||
// If the MobileFrontend extension is installed and the user is
|
||||
// logged in or recipient is not a bot if bots cannot receive thanks, show a 'Thank' link.
|
||||
if ( $rev
|
||||
|
|
Loading…
Reference in a new issue