From 020a92eda8da348c5bbd1c34643e4788b8156523 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Wed, 5 Nov 2008 01:59:27 +0000 Subject: [PATCH] BUGFIX #2992: Fixed T_PAAMAYIM_NEKUDOTAYIM error in RequestHandler git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65250 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/control/RequestHandler.php | 12 ++++++------ forms/HtmlEditorField.php | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/core/control/RequestHandler.php b/core/control/RequestHandler.php index b97a254e1..b6ee7436d 100644 --- a/core/control/RequestHandler.php +++ b/core/control/RequestHandler.php @@ -78,9 +78,9 @@ class RequestHandler extends ViewableData { $this->request = $request; // $handlerClass is used to step up the class hierarchy to implement url_handlers inheritance - $handlerClass = $this->class; + $handlerClass = ($this->class) ? $this->class : get_class($this); // We stop after RequestHandler; in other words, at ViewableData - while($handlerClass != 'ViewableData') { + while($handlerClass && $handlerClass != 'ViewableData') { // Todo: ajshort's stat rewriting could be useful here. $urlHandlers = eval("return $handlerClass::\$url_handlers;"); @@ -152,11 +152,11 @@ class RequestHandler extends ViewableData { function checkAccessAction($action) { // Collate self::$allowed_actions from this class and all parent classes $access = null; - $className = $this->class; - while($className != 'RequestHandler') { + $className = ($this->class) ? $this->class : get_class($this); + while($className && $className != 'RequestHandler') { // Merge any non-null parts onto $access. - $accessPart = eval("return $className::\$allowed_actions;"); - if($accessPart !== null) $access = array_merge((array)$access, $accessPart); + $accessPart = eval("return $className::\$allowed_actions;"); + if($accessPart != null) $access = array_merge((array)$access, $accessPart); // Build an array of parts for checking if part[0] == part[1], which means that this class doesn't directly define it. $accessParts[] = $accessPart; diff --git a/forms/HtmlEditorField.php b/forms/HtmlEditorField.php index f2e126a86..b51a99556 100755 --- a/forms/HtmlEditorField.php +++ b/forms/HtmlEditorField.php @@ -260,6 +260,8 @@ class HtmlEditorField_Toolbar extends RequestHandler { protected $controller, $name; function __construct($controller, $name) { + parent::__construct(); + $this->controller = $controller; $this->name = $name; }