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

@@ 1470-1474 (lines=5) @@
1467
				# / at end means we don't want the slash to be shown
1468
				$m = [];
1469
				$trailingSlashes = preg_match_all( '%(/+)$%', $target, $m );
1470
				if ( $trailingSlashes ) {
1471
					$noslash = $target = substr( $target, 1, -strlen( $m[0][0] ) );
1472
				} else {
1473
					$noslash = substr( $target, 1 );
1474
				}
1475
1476
				$ret = $contextTitle->getPrefixedText() . '/' . trim( $noslash ) . $suffix;
1477
				if ( $text === '' ) {