api posts cannot use one of the reserved sources: web, omb, mail or xmpp.

darcs-hash:20081210173726-099f7-5fc908c7330ec8b21d101c1498d5b78ab09ee490.gz
This commit is contained in:
millette 2008-12-10 12:37:26 -05:00
parent a143b64666
commit 9553072e49
2 changed files with 4 additions and 3 deletions

View File

@ -104,7 +104,8 @@ class Twitapidirect_messagesAction extends TwitterapiAction {
$user = $apidata['user']; $user = $apidata['user'];
$source = $this->trimmed('source'); // Not supported by Twitter. $source = $this->trimmed('source'); // Not supported by Twitter.
if (!$source) { $reserved_sources = array('web', 'omb', 'mail', 'xmpp', 'api');
if (!$source || in_array($source, $reserved_sources)) {
$source = 'api'; $source = 'api';
} }

View File

@ -239,8 +239,8 @@ class TwitapistatusesAction extends TwitterapiAction {
$status = $this->trimmed('status'); $status = $this->trimmed('status');
$source = $this->trimmed('source'); $source = $this->trimmed('source');
$in_reply_to_status_id = intval($this->trimmed('in_reply_to_status_id')); $in_reply_to_status_id = intval($this->trimmed('in_reply_to_status_id'));
$reserved_sources = array('web', 'omb', 'mail', 'xmpp', 'api');
if (!$source) { if (!$source || in_array($source, $reserved_sources)) {
$source = 'api'; $source = 'api';
} }