From e1d7ce58b1cae6ab6526d0eaeff9b75cdc76464e Mon Sep 17 00:00:00 2001 From: Dave Rowe Date: Mon, 8 Jul 2013 10:40:03 -0500 Subject: [PATCH] Fix SetTables param check In an older version of the library, a check was added to ensure invalid tables weren't searched - the count was 2. This is an artifact of the old library, and now we can check against the $valid array instead to achieve a similar result. --- src/gwtdata.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gwtdata.php b/src/gwtdata.php index bbe9347..7e26ba8 100644 --- a/src/gwtdata.php +++ b/src/gwtdata.php @@ -75,9 +75,10 @@ public function SetLanguage($str) */ public function SetTables($arr) { - if(is_array($arr) && !empty($arr) && sizeof($arr) <= 2) { - $valid = array("TOP_PAGES","TOP_QUERIES","CRAWL_ERRORS","CONTENT_ERRORS", + $valid = array("TOP_PAGES","TOP_QUERIES","CRAWL_ERRORS","CONTENT_ERRORS", "CONTENT_KEYWORDS","INTERNAL_LINKS","EXTERNAL_LINKS","SOCIAL_ACTIVITY"); + + if(is_array($arr) && !empty($arr) && count($arr) <= count($valid)) { $this->_tables = array(); for($i=0; $i < sizeof($arr); $i++) { if(in_array($arr[$i], $valid)) { @@ -398,4 +399,4 @@ private function IsISO8601($str) date('d', $stamp), date('Y', $stamp))) ? true : false; } } -?> \ No newline at end of file +?>