Permalink
Browse files

Prevents iterating more then available results (#11285)

git-svn-id: http://svn.php.net/repository/pear/packages/Services_Google/trunk@255854 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent 9c679ff commit cea4a802085b4d794eac8453791199db63975d11 @amir amir committed Mar 23, 2008
Showing with 4 additions and 0 deletions.
  1. +4 −0 Google.php
View
@@ -262,6 +262,10 @@ public function valid()
$this->runQuery();
}
+ if ($this->_index >= $this->_result->estimatedTotalResultsCount - 1) {
+ return false;
+ }
+
return (bool)count($this->_result->resultElements);
}

0 comments on commit cea4a80

Please sign in to comment.