From 0c52d36846edb9b1b89c61632fbe90250d7f36fa Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sat, 21 Nov 2009 03:19:49 +0000 Subject: [PATCH] BUGFIX Fixed undefined variable in CMSMain git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92821 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/CMSMain.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/CMSMain.php b/code/CMSMain.php index a7de6db9..1ca3250e 100755 --- a/code/CMSMain.php +++ b/code/CMSMain.php @@ -1204,6 +1204,7 @@ JS; return new HTTPResponse("Please pass an ID in the form content", 400); } + $id = (int)$data['ID']; $restoredPage = Versioned::get_latest_version("SiteTree", $id); if(!$restoredPage) return new HTTPResponse("SiteTree #$id not found", 400); @@ -1416,7 +1417,7 @@ class CMSMainMarkingFilter { break; // Match against exact ClassName case 'ClassName': - if($val != 'All') { + if($val && $val != 'All') { $where[] = "\"ClassName\" = '$val'"; } break; @@ -1429,7 +1430,7 @@ class CMSMainMarkingFilter { } $where = empty($where) ? '' : 'WHERE (' . implode(') AND (',$where) . ')'; - + $parents = array(); /* Do the actual search */