Fixing js -> php porting bugs

This commit is contained in:
Dennis Eichhorn 2016-09-15 17:00:46 +02:00
parent 15c4eca1f9
commit f5be923097

View File

@ -89,17 +89,17 @@ class UriFactory
private static function unique(string $url) : string private static function unique(string $url) : string
{ {
$parts = explode('?', url); $parts = explode('?', $url);
if (count($parts) >= 2) { if (count($parts) >= 2) {
$full = $parts[1]; $full = $parts[1];
$pars = explode('&', $full), $pars = explode('&', $full);
$comps = [], $comps = [];
$spl = null, $spl = null;
$length = count($pars); $length = count($pars);
for ($i = 0; $i < $length; $i++) { for ($i = 0; $i < $length; $i++) {
$spl = explode('=', $pars[i]); $spl = explode('=', $pars[$i]);
$comps[$spl[0]] = $spl[1]; $comps[$spl[0]] = $spl[1];
} }
@ -147,7 +147,7 @@ class UriFactory
str_replace('&', '?', $parsed); str_replace('&', '?', $parsed);
} }
$parsed = self::uniqid($parsed); $parsed = self::unique($parsed);
return $parsed; return $parsed;
} }