mirror of
https://github.com/processwire/processwire.git
synced 2025-08-15 03:05:26 +02:00
Merge branch 'feature-querystring-overrides' of https://github.com/teppokoivula/processwire-1 into teppokoivula-feature-querystring-overrides
This commit is contained in:
@@ -558,15 +558,17 @@ class WireInput extends Wire {
|
||||
* Return the unsanitized query string that was part of this request, or blank if none
|
||||
*
|
||||
* Note that the returned query string is not sanitized, so if you use it in any output
|
||||
* be sure to run it through `$sanitizer->entities()` first.
|
||||
* be sure to run it through `$sanitizer->entities()` first. An optional assoc array
|
||||
* param can be used to add new GET params or override existing ones.
|
||||
*
|
||||
* #pw-group-URLs
|
||||
*
|
||||
* @param array $overrides Optional assoc array for overriding or adding GET params
|
||||
* @return string Returns the unsanitized query string
|
||||
*
|
||||
*/
|
||||
public function queryString() {
|
||||
return $this->get()->queryString();
|
||||
public function queryString($overrides = array()) {
|
||||
return $this->get()->queryString($overrides);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -200,8 +200,8 @@ class WireInputData extends Wire implements \ArrayAccess, \IteratorAggregate, \C
|
||||
$this->offsetUnset($key);
|
||||
}
|
||||
|
||||
public function queryString() {
|
||||
return http_build_query($this->getArray());
|
||||
public function queryString($overrides = array()) {
|
||||
return http_build_query(array_merge($this->getArray(), $overrides));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user