From 677f0edcfcf7f8bd52ff3a7bccd23200d90407e8 Mon Sep 17 00:00:00 2001 From: Stephen Shkardoon Date: Mon, 5 May 2014 19:26:05 +1200 Subject: [PATCH] MINOR LeftAndMain::getRecord check $ClassName before use While the check for `$classname` was done in the first conditional, it was left out of the other two, leading to potential issues when an invalid ID was given, instead of the expected `false`. --- admin/code/LeftAndMain.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/code/LeftAndMain.php b/admin/code/LeftAndMain.php index de8a36b53..fd1f53982 100644 --- a/admin/code/LeftAndMain.php +++ b/admin/code/LeftAndMain.php @@ -627,9 +627,9 @@ class LeftAndMain extends Controller implements PermissionProvider { $className = $this->stat('tree_class'); if($className && $id instanceof $className) { return $id; - } else if($id == 'root') { + } else if($className && $id == 'root') { return singleton($className); - } else if(is_numeric($id)) { + } else if($className && is_numeric($id)) { return DataObject::get_by_id($className, $id); } else { return false;