Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BUG Make RequestProcessor->filters settable as a property too

filters was a DI property that could only be set via constructor. This meant that modules couldnt add a
filter without interfering with other modules. With this change you can now add a config block like:

Injector:
  RequestProcessor:
    properties:
      filters:
        - "%$MyFilter"

Which will add a filter to RequestProcessors list of filters
  • Loading branch information...
commit 35cc65820c2a02f97936d16622374bef1eb9b68e 1 parent 09067cc
@hafriedlander hafriedlander authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 control/RequestProcessor.php
View
4 control/RequestProcessor.php
@@ -14,6 +14,10 @@ public function __construct($filters = array()) {
$this->filters = $filters;
}
+ public function setFilters($filters) {
+ $this->filters = $filters;
+ }
+
public function preRequest(SS_HTTPRequest $request, Session $session, DataModel $model) {
foreach ($this->filters as $filter) {
$res = $filter->preRequest($request, $session, $model);
Please sign in to comment.
Something went wrong with that request. Please try again.