Code Duplication    Length = 4-9 lines in 2 locations

includes/parser/Parser.php 2 locations

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