mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-08 05:18:40 +00:00
remove empty url query parameters
This commit is contained in:
parent
5aa0276f11
commit
2bcf7b78a4
|
|
@ -216,6 +216,12 @@ final class UriFactory
|
||||||
}
|
}
|
||||||
|
|
||||||
\parse_str($urlStructure['query'], $urlStructure['query']);
|
\parse_str($urlStructure['query'], $urlStructure['query']);
|
||||||
|
|
||||||
|
foreach ($urlStructure['query'] as $para => $query) {
|
||||||
|
if ($query === '' && \stripos($url, $para . '=') !== false) {
|
||||||
|
unset($urlStructure['query'][$para]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$escaped =
|
$escaped =
|
||||||
|
|
@ -268,10 +274,14 @@ final class UriFactory
|
||||||
return $uri;
|
return $uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (\stripos($uri, '{?u')) {
|
||||||
|
$a = 1;
|
||||||
|
}
|
||||||
|
|
||||||
$parsed = \preg_replace_callback('(\{[\/#\?%@\.\$][a-zA-Z0-9\-]*\})', function ($match) use ($toMatch) {
|
$parsed = \preg_replace_callback('(\{[\/#\?%@\.\$][a-zA-Z0-9\-]*\})', function ($match) use ($toMatch) {
|
||||||
$match = \substr($match[0], 1, \strlen($match[0]) - 2);
|
$match = \substr($match[0], 1, \strlen($match[0]) - 2);
|
||||||
|
|
||||||
return $toMatch[$match] ?? self::$uri[$match] ?? $match;
|
return $toMatch[$match] ?? self::$uri[$match] ?? '';
|
||||||
}, $uri);
|
}, $uri);
|
||||||
|
|
||||||
return self::unique($parsed ?? '');
|
return self::unique($parsed ?? '');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user