Code Duplication    Length = 17-18 lines in 2 locations

includes/page/Article.php 1 location

@@ 1263-1280 (lines=18) @@
1260
			if ( !( $user && $user->isLoggedIn() ) && !$ip ) { # User does not exist
1261
				$outputPage->wrapWikiMsg( "<div class=\"mw-userpage-userdoesnotexist error\">\n\$1\n</div>",
1262
					[ 'userpage-userdoesnotexist-view', wfEscapeWikiText( $rootPart ) ] );
1263
			} elseif ( !is_null( $block ) && $block->getType() != Block::TYPE_AUTO ) {
1264
				# Show log extract if the user is currently blocked
1265
				LogEventsList::showLogExtract(
1266
					$outputPage,
1267
					'block',
1268
					MWNamespace::getCanonicalName( NS_USER ) . ':' . $block->getTarget(),
1269
					'',
1270
					[
1271
						'lim' => 1,
1272
						'showIfEmpty' => false,
1273
						'msgKey' => [
1274
							'blocked-notice-logextract',
1275
							$user->getName() # Support GENDER in notice
1276
						]
1277
					]
1278
				);
1279
				$validUserPage = !$title->isSubpage();
1280
			} else {
1281
				$validUserPage = !$title->isSubpage();
1282
			}
1283
		}

includes/EditPage.php 1 location

@@ 2333-2349 (lines=17) @@
2330
			if ( !( $user && $user->isLoggedIn() ) && !$ip ) { # User does not exist
2331
				$wgOut->wrapWikiMsg( "<div class=\"mw-userpage-userdoesnotexist error\">\n$1\n</div>",
2332
					[ 'userpage-userdoesnotexist', wfEscapeWikiText( $username ) ] );
2333
			} elseif ( !is_null( $block ) && $block->getType() != Block::TYPE_AUTO ) {
2334
				# Show log extract if the user is currently blocked
2335
				LogEventsList::showLogExtract(
2336
					$wgOut,
2337
					'block',
2338
					MWNamespace::getCanonicalName( NS_USER ) . ':' . $block->getTarget(),
2339
					'',
2340
					[
2341
						'lim' => 1,
2342
						'showIfEmpty' => false,
2343
						'msgKey' => [
2344
							'blocked-notice-logextract',
2345
							$user->getName() # Support GENDER in notice
2346
						]
2347
					]
2348
				);
2349
			}
2350
		}
2351
		# Try to add a custom edit intro, or use the standard one if this is not possible.
2352
		if ( !$this->showCustomIntro() && !$this->mTitle->exists() ) {