Code Duplication    Length = 9-10 lines in 2 locations

includes/EditPage.php 2 locations

@@ 1761-1770 (lines=10) @@
1758
			return $status;
1759
		}
1760
1761
		if ( !$wgUser->isAllowed( 'edit' ) ) {
1762
			if ( $wgUser->isAnon() ) {
1763
				$status->setResult( false, self::AS_READ_ONLY_PAGE_ANON );
1764
				return $status;
1765
			} else {
1766
				$status->fatal( 'readonlytext' );
1767
				$status->value = self::AS_READ_ONLY_PAGE_LOGGED;
1768
				return $status;
1769
			}
1770
		}
1771
1772
		$changingContentModel = false;
1773
		if ( $this->contentModel !== $this->mTitle->getContentModel() ) {
@@ 1774-1782 (lines=9) @@
1771
1772
		$changingContentModel = false;
1773
		if ( $this->contentModel !== $this->mTitle->getContentModel() ) {
1774
			if ( !$wgContentHandlerUseDB ) {
1775
				$status->fatal( 'editpage-cannot-use-custom-model' );
1776
				$status->value = self::AS_CANNOT_USE_CUSTOM_MODEL;
1777
				return $status;
1778
			} elseif ( !$wgUser->isAllowed( 'editcontentmodel' ) ) {
1779
				$status->setResult( false, self::AS_NO_CHANGE_CONTENT_MODEL );
1780
				return $status;
1781
1782
			}
1783
			$changingContentModel = true;
1784
			$oldContentModel = $this->mTitle->getContentModel();
1785
		}