Skip to content

Commit c1b3f87

Browse files
committed
fix: remove dead code
Since I was able to return earlier in `filterPath()`, I was able to remove a number of dead conditionals. Signed-off-by: Matthew Weier O'Phinney <matthew@weierophinney.net>
1 parent b17abb2 commit c1b3f87

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

src/Uri.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -573,19 +573,6 @@ private function filterPath(string $path): string
573573
[$this, 'urlEncodeChar'],
574574
$path
575575
);
576-
577-
if ('' === $path) {
578-
// No path
579-
return $path;
580-
}
581-
582-
if ($path[0] !== '/') {
583-
// Relative path
584-
return $path;
585-
}
586-
587-
// Ensure only one leading slash, to prevent XSS attempts.
588-
return '/' . ltrim($path, '/');
589576
}
590577

591578
/**

0 commit comments

Comments
 (0)