mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Prevent handling of controller actions which return $this avoid infinite loops in RequestHandler->handleRequest (thanks Hamish!) (from r102004)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112054 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
740e49061f
commit
1d61bf7100
@ -145,9 +145,10 @@ class RequestHandler extends ViewableData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If we return a RequestHandler, call handleRequest() on that, even if there is no more URL to parse.
|
// If we return a RequestHandler, call handleRequest() on that, even if there is no more URL to parse.
|
||||||
// It might have its own handler. However, we only do this if we haven't just parsed an empty rule ourselves,
|
// It might have its own handler. However, we only do this if we haven't just parsed an empty rule ourselves,
|
||||||
// to prevent infinite loops
|
// to prevent infinite loops. Also prevent further handling of controller actions which return themselves
|
||||||
if(!$request->isEmptyPattern($rule) && is_object($result) && $result instanceof RequestHandler) {
|
// to avoid infinite loops.
|
||||||
|
if($this !== $result && !$request->isEmptyPattern($rule) && is_object($result) && $result instanceof RequestHandler) {
|
||||||
$returnValue = $result->handleRequest($request);
|
$returnValue = $result->handleRequest($request);
|
||||||
|
|
||||||
// Array results can be used to handle
|
// Array results can be used to handle
|
||||||
|
Loading…
Reference in New Issue
Block a user