Skip to content

Commit

Permalink
fix: remove dead code
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
weierophinney committed Dec 14, 2022
1 parent b17abb2 commit c1b3f87
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/Uri.php
Original file line number Diff line number Diff line change
Expand Up @@ -573,19 +573,6 @@ private function filterPath(string $path): string
[$this, 'urlEncodeChar'],
$path
);

if ('' === $path) {
// No path
return $path;
}

if ($path[0] !== '/') {
// Relative path
return $path;
}

// Ensure only one leading slash, to prevent XSS attempts.
return '/' . ltrim($path, '/');
}

/**
Expand Down

0 comments on commit c1b3f87

Please sign in to comment.