Default to RFC3986 encoding for getParamString in HttpRequest.

This commit is contained in:
flash 2023-01-07 19:03:43 +00:00
parent fbe4fe18de
commit 30064e6891
2 changed files with 4 additions and 4 deletions

View File

@ -1 +1 @@
0.2301.70411
0.2301.71902

View File

@ -1,7 +1,7 @@
<?php
// HttpRequest.php
// Created: 2022-02-08
// Updated: 2023-01-01
// Updated: 2023-01-07
namespace Index\Http;
@ -44,8 +44,8 @@ class HttpRequest extends HttpMessage {
return $this->path;
}
public function getParamString(): string {
return http_build_query($this->params);
public function getParamString(bool $spacesAsPlus = false): string {
return http_build_query($this->params, '', '&', $spacesAsPlus ? PHP_QUERY_RFC1738 : PHP_QUERY_RFC3986);
}
public function getParams(): array {