*/
use MediaWiki\MediaWikiServices;
+use MediaWiki\Permissions\PermissionManager;
use MediaWiki\Revision\RevisionRecord;
use MediaWiki\Revision\SlotRecord;
use MediaWiki\Storage\NameTableAccessException;
$samePage = false;
}
- if ( $samePage && $this->mNewPage && $this->mNewPage->quickUserCan( 'edit', $user ) ) {
- if ( $this->mNewRev->isCurrent() && $this->mNewPage->userCan( 'rollback', $user ) ) {
+ $permissionManager = MediaWikiServices::getInstance()->getPermissionManager();
+
+ if ( $samePage && $this->mNewPage && $permissionManager->userCan(
+ 'edit', $user, $this->mNewPage, PermissionManager::RIGOR_QUICK
+ ) ) {
+ if ( $this->mNewRev->isCurrent() && $permissionManager->userCan(
+ 'rollback', $user, $this->mNewPage
+ ) ) {
$rollbackLink = Linker::generateRollback( $this->mNewRev, $this->getContext() );
if ( $rollbackLink ) {
$out->preventClickjacking();
if ( $engine === 'wikidiff2' ) {
$params[] = phpversion( 'wikidiff2' );
- $params[] = $this->getConfig()->get( 'WikiDiff2MovedParagraphDetectionCutoff' );
}
if ( !$this->isSlotDiffRenderer ) {
* by the request context); if oldid is 0, then compare the revision in newid to the
* immediately previous one.
*
- * If oldid is false, leave the corresponding revision object set
- * to false. This can happen with 'diff=prev' pointing to a non-existent revision,
- * and is also used directly by the API.
+ * If oldid is false, leave the corresponding revision object set to false. This can
+ * happen with 'diff=prev' pointing to a non-existent revision, and is also used directly
+ * by the API.
*
* @return bool Whether both revisions were loaded successfully. Setting mOldRev
* to false counts as successful loading.
*/
public function loadRevisionData() {
if ( $this->mRevisionsLoaded ) {
- return $this->isContentOverridden || $this->mNewRev && !is_null( $this->mOldRev );
+ return $this->isContentOverridden || ( $this->mOldRev !== null && $this->mNewRev !== null );
}
// Whether it succeeds or fails, we don't want to try again