From fba140f4e0246a244664f0c0fb2361b027508d35 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Fri, 7 May 2010 16:32:24 -0700 Subject: Fix for repeats from the API having null source attribution --- lib/apiaction.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/apiaction.php') diff --git a/lib/apiaction.php b/lib/apiaction.php index 59dc47c23..f87b04611 100644 --- a/lib/apiaction.php +++ b/lib/apiaction.php @@ -63,9 +63,12 @@ class ApiAction extends Action var $count = null; var $max_id = null; var $since_id = null; + var $source = null; var $access = self::READ_ONLY; // read (default) or read-write + static $reserved_sources = array('web', 'omb', 'ostatus', 'mail', 'xmpp', 'api'); + /** * Initialization. * @@ -89,6 +92,12 @@ class ApiAction extends Action header('X-StatusNet-Warning: since parameter is disabled; use since_id'); } + $this->source = $this->trimmed('source'); + + if (empty($this->source) || in_array($this->source, self::$reserved_sources)) { + $this->source = 'api'; + } + return true; } -- cgit v1.2.3-54-g00ecf