$user = $context->getUser();
$sk = $context->getSkin();
$list = null;
- if ( Hooks::run( 'FetchChangesList', [ $user, &$sk, &$list ] ) ) {
+ if ( Hooks::run( 'FetchChangesList', [ $user, &$sk, &$list, $groups ] ) ) {
$new = $context->getRequest()->getBool( 'enhanced', $user->getOption( 'usenewrc' ) );
return $new ?
* field of this revision, if it's marked as deleted.
* @param RCCacheEntry|RecentChange $rc
* @param int $field
- * @param User|null $user User object to check, or null to use $wgUser
+ * @param User|null $user User object to check against. If null, the global RequestContext's
+ * User is assumed instead.
* @return bool
*/
public static function userCan( $rc, $field, User $user = null ) {
+ if ( $user === null ) {
+ $user = RequestContext::getMain()->getUser();
+ }
+
if ( $rc->mAttribs['rc_type'] == RC_LOG ) {
return LogEventsList::userCanBitfield( $rc->mAttribs['rc_deleted'], $field, $user );
- } else {
- return Revision::userCanBitfield( $rc->mAttribs['rc_deleted'], $field, $user );
}
+
+ return RevisionRecord::userCanBitfield( $rc->mAttribs['rc_deleted'], $field, $user );
}
/**
) {
$title = $rc->getTitle();
/** Check for rollback permissions, disallow special pages, and only
- * show a link on the top-most revision */
+ * show a link on the top-most revision
+ */
if ( $title->quickUserCan( 'rollback', $this->getUser() ) ) {
$rev = new Revision( [
'title' => $title,