From: Zach Copley Date: Tue, 30 Jun 2009 23:25:52 +0000 (-0700) Subject: Merge commit 'jeff-themovie/small-fixes' into 0.8.x X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ccbc5c447df5a5284b8845d9a53f28d17d8df875;p=quix0rs-gnu-social.git Merge commit 'jeff-themovie/small-fixes' into 0.8.x * commit 'jeff-themovie/small-fixes': Fix missing max_id in API search calls Fix "Trying to get property of non-object" errors when a user tries to log in using an unknown nickname Fix "Trying to get property of non-object" errors when accessing the people search results page Fix "Undefined variable: cnt" Fix "Trying to get property of non-object" errors in groupeditform.php Fix "Undefined property: DisfavorAction::$id" --- ccbc5c447df5a5284b8845d9a53f28d17d8df875 diff --cc actions/twitapisearchatom.php index 708b1494d1,c223a7e27c..3678213c3a --- a/actions/twitapisearchatom.php +++ b/actions/twitapisearchatom.php @@@ -165,29 -165,25 +165,30 @@@ class TwitapisearchatomAction extends T $search_engine->set_sort_mode('chron'); $search_engine->limit(($this->page - 1) * $this->rpp, $this->rpp + 1, true); - $search_engine->query($q); - $this->cnt = $notice->find(); + if (false === $search_engine->query($q)) { + $this->cnt = 0; + } else { + $this->cnt = $notice->find(); + } $cnt = 0; + $this->max_id = 0; - while ($notice->fetch()) { + if ($this->cnt > 0) { + while ($notice->fetch()) { - ++$cnt; + ++$cnt; - if (!$this->max_id) { - $this->max_id = $notice->id; - } + if (!$this->max_id) { + $this->max_id = $notice->id; + } - if ($cnt > $this->rpp) { - break; - } + if ($cnt > $this->rpp) { + break; + } - $notices[] = clone($notice); + $notices[] = clone($notice); + } } return $notices;