Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions phalcon/Http/Request.zep
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use Phalcon\Filter\FilterInterface;
use Phalcon\Http\Message\RequestMethodInterface;
use Phalcon\Http\Request\File;
use Phalcon\Http\Request\FileInterface;
use Phalcon\Filter\FilterFactory;
use Phalcon\Http\Request\Exception;
use Phalcon\Support\Helper\Json\Decode;
use UnexpectedValueException;
Expand Down Expand Up @@ -1646,15 +1647,13 @@ class Request extends AbstractInjectionAware implements RequestInterface, Reques

if typeof filterService != "object" {
let container = <DiInterface> this->container;

if container === null {
throw new Exception(
"A dependency injection container is required to access the 'filter' service"
);
if typeof container == "object" && container->has("filter") {
let filter = <FilterInterface> container->getShared("filter"),
this->filterService = filter;
} else {
this->filterService = (new FilterFactory())->newInstance();
}

let filterService = <FilterInterface> container->getShared("filter"),
this->filterService = filterService;
this->filterService = filterService;
}

return this->filterService;
Expand Down