]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
api posts cannot use one of the reserved sources: web, omb, mail or xmpp.
authormillette <millette@controlyourself.ca>
Wed, 10 Dec 2008 17:37:26 +0000 (12:37 -0500)
committermillette <millette@controlyourself.ca>
Wed, 10 Dec 2008 17:37:26 +0000 (12:37 -0500)
darcs-hash:20081210173726-099f7-5fc908c7330ec8b21d101c1498d5b78ab09ee490.gz

actions/twitapidirect_messages.php
actions/twitapistatuses.php

index ed2d5c5d1cfb3d01081cd1d664cbeb70402479c0..a04ae5fa76f0c795ea858051e062052f4768333a 100644 (file)
@@ -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';
                }
 
index 1b095079aabf941e4274f36d398b8c7878797da7..6d6d5266ffb80e99ee8ca3a0bdbfc935fefa4664 100644 (file)
@@ -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';
                }