From bc4e843f396dc450b04b612e7de14246084469d1 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 8 Feb 2010 19:22:55 -0800 Subject: Disable deprecated 'since' parameter on public_timeline API; causes performance problems. (since_id will work cleanly) --- actions/apitimelinepublic.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'actions') diff --git a/actions/apitimelinepublic.php b/actions/apitimelinepublic.php index 3f4a46c0f..0fb0788e9 100644 --- a/actions/apitimelinepublic.php +++ b/actions/apitimelinepublic.php @@ -74,6 +74,10 @@ class ApiTimelinePublicAction extends ApiPrivateAuthAction parent::prepare($args); $this->notices = $this->getNotices(); + + if ($this->since) { + throw new ServerException("since parameter is disabled for performance; use since_id", 403); + } return true; } @@ -145,7 +149,7 @@ class ApiTimelinePublicAction extends ApiPrivateAuthAction $notice = Notice::publicStream( ($this->page - 1) * $this->count, $this->count, $this->since_id, - $this->max_id, $this->since + $this->max_id ); while ($notice->fetch()) { -- cgit v1.2.3-54-g00ecf From 70d5f39ed66cb277e925ea71dcc24ca580110b3d Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Mon, 8 Feb 2010 21:52:05 -0800 Subject: Better checking for duplicate app names --- actions/editapplication.php | 2 +- actions/newapplication.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'actions') diff --git a/actions/editapplication.php b/actions/editapplication.php index ca5dba1e4..64cf0a574 100644 --- a/actions/editapplication.php +++ b/actions/editapplication.php @@ -277,7 +277,7 @@ class EditApplicationAction extends OwnerDesignAction function nameExists($name) { $newapp = Oauth_application::staticGet('name', $name); - if (!$newapp) { + if (empty($newapp)) { return false; } else { return $newapp->id != $this->app->id; diff --git a/actions/newapplication.php b/actions/newapplication.php index c0c520797..0f819b349 100644 --- a/actions/newapplication.php +++ b/actions/newapplication.php @@ -290,7 +290,7 @@ class NewApplicationAction extends OwnerDesignAction function nameExists($name) { $app = Oauth_application::staticGet('name', $name); - return ($app !== false); + return !empty($app); } } -- cgit v1.2.3-54-g00ecf