Code Duplication    Length = 4-9 lines in 2 locations

includes/parser/Parser.php 2 locations

@@ 1524-1532 (lines=9) @@
1521
		# URLs, per RFC 2396.
1522
		# Make   terminate a URL as well (bug T84937)
1523
		$m2 = [];
1524
		if ( preg_match(
1525
			'/&(lt|gt|nbsp|#x0*(3[CcEe]|[Aa]0)|#0*(60|62|160));/',
1526
			$url,
1527
			$m2,
1528
			PREG_OFFSET_CAPTURE
1529
		) ) {
1530
			$trail = substr( $url, $m2[0][1] ) . $trail;
1531
			$url = substr( $url, 0, $m2[0][1] );
1532
		}
1533
1534
		# Move trailing punctuation to $trail
1535
		$sep = ',;\.:!?';
@@ 1834-1837 (lines=4) @@
1831
			# removeHTMLtags()) should not be included in
1832
			# URLs, per RFC 2396.
1833
			$m2 = [];
1834
			if ( preg_match( '/&(lt|gt);/', $url, $m2, PREG_OFFSET_CAPTURE ) ) {
1835
				$text = substr( $url, $m2[0][1] ) . ' ' . $text;
1836
				$url = substr( $url, 0, $m2[0][1] );
1837
			}
1838
1839
			# If the link text is an image URL, replace it with an <img> tag
1840
			# This happened by accident in the original parser, but some people used it extensively