diff --git a/classes/Betterrest.php b/classes/Betterrest.php index f50bf8c..612f90e 100644 --- a/classes/Betterrest.php +++ b/classes/Betterrest.php @@ -80,9 +80,17 @@ public function contentFromRequest(?\Kirby\Http\Request $request = null): ?array } // options from query - $queryToOptions = array_merge(\Kirby\Toolkit\A::get($this->options, 'query', []), $request->query()->toArray()); + $query = $request->query()->toArray(); + $queryToOptions = array_merge(\Kirby\Toolkit\A::get($this->options, 'query', []), $query); $this->options = array_merge($this->options, $this->optionsFromQuery($queryToOptions)); + $queryWithoutBetterRestParams = $query; + foreach($query as $key => $value) { + if (substr($key, 0, 3) === 'br-') { + unset($queryWithoutBetterRestParams[$key]); + } + } + // method api() is @internal $render = $this->kirby->api()->render( (string) $path, @@ -90,7 +98,7 @@ public function contentFromRequest(?\Kirby\Http\Request $request = null): ?array [ // 'body' => $request->body()->toArray(), 'headers' => $request->headers(), - 'query' => $request->query()->toArray(), + 'query' => $queryWithoutBetterRestParams, ] );