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
This commit is contained in:
Sam Minnee 2008-11-05 01:59:27 +00:00
parent bb20921fef
commit 020a92eda8
2 changed files with 8 additions and 6 deletions

View File

@ -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;

View File

@ -260,6 +260,8 @@ class HtmlEditorField_Toolbar extends RequestHandler {
protected $controller, $name;
function __construct($controller, $name) {
parent::__construct();
$this->controller = $controller;
$this->name = $name;
}