Expose getParamString on UrlEncodedFormContent.
This commit is contained in:
parent
fe6c62e1c0
commit
71435ba877
2 changed files with 14 additions and 2 deletions
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
0.2503.192123
|
||||
0.2503.200311
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
// UrlEncodedFormContent.php
|
||||
// Created: 2025-03-12
|
||||
// Updated: 2025-03-15
|
||||
// Updated: 2025-03-20
|
||||
|
||||
namespace Index\Http\Content;
|
||||
|
||||
|
@ -55,6 +55,18 @@ class UrlEncodedFormContent implements FormContent {
|
|||
++$this->position;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves all post fields as a query string.
|
||||
*
|
||||
* @param ?bool $spacesAsPlus null to use the Index url encoder, other wise whether to represent spaces as a + instead of %20 with the legacy encoder.
|
||||
* @return string Query string representation of post fields.
|
||||
*/
|
||||
public function getParamString(?bool $spacesAsPlus = null): string {
|
||||
return $spacesAsPlus === null
|
||||
? HttpUri::buildQueryString($this->params)
|
||||
: http_build_query($this->params, '', '&', $spacesAsPlus ? PHP_QUERY_RFC1738 : PHP_QUERY_RFC3986);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses URL encoded form params in a stream.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue