From e4d2b1ffa28d8b09f1bbefa9ecd49aedbb922d6b Mon Sep 17 00:00:00 2001 From: Matt Peel Date: Wed, 17 Oct 2007 03:22:37 +0000 Subject: [PATCH] Removed 2 notices from SearchForm git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@43507 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- search/SearchForm.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/search/SearchForm.php b/search/SearchForm.php index 4853af86c..4ec5ea016 100755 --- a/search/SearchForm.php +++ b/search/SearchForm.php @@ -127,7 +127,8 @@ class SearchForm extends Form { if($this->showInSearchTurnOn) $extraFilter .= " AND showInSearch <> 0"; - $limit = (int)$_GET['start'] . ", " . (int) $numPerPage; + $start = isset($_GET['start']) ? (int)$_GET['start'] : 0; + $limit = $start . ", " . (int) $numPerPage; $notMatch = $invertedMatch ? "NOT " : ""; if($keywords) { @@ -171,7 +172,7 @@ class SearchForm extends Form { $objects[] = new $record['ClassName']($record); $doSet = new DataObjectSet($objects); - $doSet->setPageLimits($_GET['start'], $numPerPage, $totalCount); + $doSet->setPageLimits(isset($_GET['start']) ? (int)$_GET['start'] : 0, $numPerPage, $totalCount); return $doSet;