Code Duplication    Length = 9-10 lines in 2 locations

includes/EditPage.php 2 locations

@@ 1850-1859 (lines=10) @@
1847
			return $status;
1848
		}
1849
1850
		if ( !$wgUser->isAllowed( 'edit' ) ) {
1851
			if ( $wgUser->isAnon() ) {
1852
				$status->setResult( false, self::AS_READ_ONLY_PAGE_ANON );
1853
				return $status;
1854
			} else {
1855
				$status->fatal( 'readonlytext' );
1856
				$status->value = self::AS_READ_ONLY_PAGE_LOGGED;
1857
				return $status;
1858
			}
1859
		}
1860
1861
		$changingContentModel = false;
1862
		if ( $this->contentModel !== $this->mTitle->getContentModel() ) {
@@ 1863-1871 (lines=9) @@
1860
1861
		$changingContentModel = false;
1862
		if ( $this->contentModel !== $this->mTitle->getContentModel() ) {
1863
			if ( !$wgContentHandlerUseDB ) {
1864
				$status->fatal( 'editpage-cannot-use-custom-model' );
1865
				$status->value = self::AS_CANNOT_USE_CUSTOM_MODEL;
1866
				return $status;
1867
			} elseif ( !$wgUser->isAllowed( 'editcontentmodel' ) ) {
1868
				$status->setResult( false, self::AS_NO_CHANGE_CONTENT_MODEL );
1869
				return $status;
1870
			}
1871
			// Make sure the user can edit the page under the new content model too
1872
			$titleWithNewContentModel = clone $this->mTitle;
1873
			$titleWithNewContentModel->setContentModel( $this->contentModel );
1874
			if ( !$titleWithNewContentModel->userCan( 'editcontentmodel', $wgUser )