Code Duplication    Length = 5-5 lines in 2 locations

includes/MagicWordArray.php 1 location

@@ 319-323 (lines=5) @@
316
			}
317
			if ( preg_match( $regex, $text, $m ) ) {
318
				list( $id, ) = $this->parseMatch( $m );
319
				if ( strlen( $m[0] ) >= strlen( $text ) ) {
320
					$text = '';
321
				} else {
322
					$text = substr( $text, strlen( $m[0] ) );
323
				}
324
				return $id;
325
			}
326
		}

includes/Linker.php 1 location

@@ 1602-1606 (lines=5) @@
1599
				# / at end means we don't want the slash to be shown
1600
				$m = [];
1601
				$trailingSlashes = preg_match_all( '%(/+)$%', $target, $m );
1602
				if ( $trailingSlashes ) {
1603
					$noslash = $target = substr( $target, 1, -strlen( $m[0][0] ) );
1604
				} else {
1605
					$noslash = substr( $target, 1 );
1606
				}
1607
1608
				$ret = $contextTitle->getPrefixedText() . '/' . trim( $noslash ) . $suffix;
1609
				if ( $text === '' ) {