Code Duplication    Length = 4-9 lines in 2 locations

includes/parser/Parser.php 2 locations

@@ 1499-1507 (lines=9) @@
1496
		# URLs, per RFC 2396.
1497
		# Make   terminate a URL as well (bug T84937)
1498
		$m2 = [];
1499
		if ( preg_match(
1500
			'/&(lt|gt|nbsp|#x0*(3[CcEe]|[Aa]0)|#0*(60|62|160));/',
1501
			$url,
1502
			$m2,
1503
			PREG_OFFSET_CAPTURE
1504
		) ) {
1505
			$trail = substr( $url, $m2[0][1] ) . $trail;
1506
			$url = substr( $url, 0, $m2[0][1] );
1507
		}
1508
1509
		# Move trailing punctuation to $trail
1510
		$sep = ',;\.:!?';
@@ 1809-1812 (lines=4) @@
1806
			# removeHTMLtags()) should not be included in
1807
			# URLs, per RFC 2396.
1808
			$m2 = [];
1809
			if ( preg_match( '/&(lt|gt);/', $url, $m2, PREG_OFFSET_CAPTURE ) ) {
1810
				$text = substr( $url, $m2[0][1] ) . ' ' . $text;
1811
				$url = substr( $url, 0, $m2[0][1] );
1812
			}
1813
1814
			# If the link text is an image URL, replace it with an <img> tag
1815
			# This happened by accident in the original parser, but some people used it extensively