From: millette Date: Wed, 10 Dec 2008 17:37:26 +0000 (-0500) Subject: api posts cannot use one of the reserved sources: web, omb, mail or xmpp. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9553072e49518c8902a0ff7bc66bb18130dcf521;p=quix0rs-gnu-social.git api posts cannot use one of the reserved sources: web, omb, mail or xmpp. darcs-hash:20081210173726-099f7-5fc908c7330ec8b21d101c1498d5b78ab09ee490.gz --- diff --git a/actions/twitapidirect_messages.php b/actions/twitapidirect_messages.php index ed2d5c5d1c..a04ae5fa76 100644 --- a/actions/twitapidirect_messages.php +++ b/actions/twitapidirect_messages.php @@ -104,7 +104,8 @@ class Twitapidirect_messagesAction extends TwitterapiAction { $user = $apidata['user']; $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'; } diff --git a/actions/twitapistatuses.php b/actions/twitapistatuses.php index 1b095079aa..6d6d5266ff 100644 --- a/actions/twitapistatuses.php +++ b/actions/twitapistatuses.php @@ -239,8 +239,8 @@ class TwitapistatusesAction extends TwitterapiAction { $status = $this->trimmed('status'); $source = $this->trimmed('source'); $in_reply_to_status_id = intval($this->trimmed('in_reply_to_status_id')); - - if (!$source) { + $reserved_sources = array('web', 'omb', 'mail', 'xmpp', 'api'); + if (!$source || in_array($source, $reserved_sources)) { $source = 'api'; }