diff options
author | Zach Copley <zach@status.net> | 2010-05-07 16:32:24 -0700 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2010-05-07 16:32:24 -0700 |
commit | 3c9686e80f50f24f302abf5dd27b74a44fa4ae56 (patch) | |
tree | 72b1a7e0c9a817b80110e49b99c79ed615f911ca /lib/apiaction.php | |
parent | d57e1deaec7406c63f70b8a5664746d18c1125ff (diff) |
Fix for repeats from the API having null source attribution
Diffstat (limited to 'lib/apiaction.php')
-rw-r--r-- | lib/apiaction.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/apiaction.php b/lib/apiaction.php index 42aa08ef7..80a8a08d1 100644 --- a/lib/apiaction.php +++ b/lib/apiaction.php @@ -124,9 +124,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. * @@ -150,6 +153,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; } |