]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge commit 'jeff-themovie/small-fixes' into 0.8.x
authorZach Copley <zach@controlyourself.ca>
Tue, 30 Jun 2009 23:25:52 +0000 (16:25 -0700)
committerZach Copley <zach@controlyourself.ca>
Tue, 30 Jun 2009 23:25:52 +0000 (16:25 -0700)
* 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"

1  2 
actions/twitapisearchatom.php
lib/util.php

index 708b1494d1e54cc9ff498150d4d323e390be8df9,c223a7e27c19e4a196508caa27350b93b666b0c8..3678213c3a9dbddd34050b9a4936b3f49d6a573f
@@@ -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;
diff --cc lib/util.php
Simple merge