Attempt to fix binary data in URL decode.

This commit is contained in:
flash 2025-03-20 23:36:14 +00:00
parent 1ba9e8fa34
commit c000efa8e5
Signed by: flash
GPG key ID: 2C9C2C574D47FE3E
2 changed files with 4 additions and 4 deletions

View file

@ -1 +1 @@
0.2503.201929
0.2503.202335

View file

@ -1,7 +1,7 @@
<?php
// HttpUri.php
// Created: 2025-02-28
// Updated: 2025-03-08
// Updated: 2025-03-20
namespace Index\Http;
@ -272,10 +272,10 @@ class HttpUri implements UriInterface, Stringable {
$paramParts = explode('&', $query);
foreach($paramParts as $paramPart) {
$parts = explode('=', $paramPart, 2);
$name = urldecode($parts[0]);
$name = ctype_print($parts[0]) ? urldecode($parts[0]) : $parts[0];
if(!array_key_exists($name, $params))
$params[$name] = [];
$params[$name][] = count($parts) > 1 ? urldecode($parts[1]) : null;
$params[$name][] = count($parts) > 1 ? (ctype_print($parts[1]) ? urldecode($parts[1]) : $parts[1]) : null;
}
}