mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-06 23:33:13 +08:00
Fixed duplicated slashes generated in path when doing not-found redirects with placeholders
This commit is contained in:
@@ -70,7 +70,10 @@ class NotFoundRedirectResolver implements NotFoundRedirectResolverInterface
|
||||
$replacePlaceholderForPattern(self::DOMAIN_PLACEHOLDER, $domain, $modifier),
|
||||
$replacePlaceholderForPattern(self::ORIGINAL_PATH_PLACEHOLDER, $path, $modifier),
|
||||
);
|
||||
$replacePlaceholdersInPath = $replacePlaceholders('\Functional\id');
|
||||
$replacePlaceholdersInPath = compose(
|
||||
$replacePlaceholders('\Functional\id'),
|
||||
static fn (?string $path) => $path === null ? null : str_replace('//', '/', $path), // Fix duplicated bars
|
||||
);
|
||||
$replacePlaceholdersInQuery = $replacePlaceholders('\urlencode');
|
||||
|
||||
return $redirectUri
|
||||
|
||||
Reference in New Issue
Block a user