diff --git a/wire/core/WireInput.php b/wire/core/WireInput.php index a42f3bb4..910d2300 100644 --- a/wire/core/WireInput.php +++ b/wire/core/WireInput.php @@ -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); } /** diff --git a/wire/core/WireInputData.php b/wire/core/WireInputData.php index 1794ef18..338c5850 100644 --- a/wire/core/WireInputData.php +++ b/wire/core/WireInputData.php @@ -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)); } /**