Skip to content

Commit

Permalink
fix: Normalize the incoming url and path so that `mergUrlWithPath…
Browse files Browse the repository at this point in the history
…()` handles edge-cases properly ([#1512](nystudio107/craft-seomatic#1512))
  • Loading branch information
khalwat committed Sep 16, 2024
1 parent f36dea3 commit 6588093
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/helpers/UrlHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ public static function mergeUrlWithPath($url, $path): string
$overlap = 0;
$url = $url ?? '';
$path = $path ?? '';
$url = rtrim($url, '/') . '/';
$path = '/' . ltrim($path, '/');
$urlOffset = strlen($url);
$pathLength = strlen($path);
$pathOffset = 0;
Expand Down

0 comments on commit 6588093

Please sign in to comment.