aboutsummaryrefslogtreecommitdiffstats
path: root/include/api.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-07-29 16:05:41 -0700
committerFriendika <info@friendika.com>2011-07-29 16:05:41 -0700
commitc9d17c78a6d10f73baac19e2735e025642f6334a (patch)
tree9b2312cd5fad81d1283a78dc2c73a3b781bdf7e8 /include/api.php
parentef47a1cf973a66bb22c1d72dc2a3130db9324e1f (diff)
parentba0a71020863883d6e36c464f06e86257bf8a018 (diff)
downloadvolse-hubzilla-c9d17c78a6d10f73baac19e2735e025642f6334a.tar.gz
volse-hubzilla-c9d17c78a6d10f73baac19e2735e025642f6334a.tar.bz2
volse-hubzilla-c9d17c78a6d10f73baac19e2735e025642f6334a.zip
Merge branch 'pull'
Diffstat (limited to 'include/api.php')
-rw-r--r--include/api.php23
1 files changed, 17 insertions, 6 deletions
diff --git a/include/api.php b/include/api.php
index d7c0124d7..bc981646d 100644
--- a/include/api.php
+++ b/include/api.php
@@ -323,20 +323,31 @@
api_register_func('api/account/verify_credentials','api_account_verify_credentials', true);
+ /**
+ * get data from $_POST or $_GET
+ */
+ function requestdata($k){
+ if (isset($_POST[$k])){
+ return $_POST[$k];
+ }
+ if (isset($_GET[$k])){
+ return $_GET[$k];
+ }
+ return null;
+ }
// TODO - media uploads
-
function api_statuses_update(&$a, $type) {
if (local_user()===false) return false;
$user_info = api_get_user($a);
// convert $_POST array items to the form we use for web posts.
- $_POST['body'] = urldecode($_POST['status']);
- $_POST['parent'] = $_POST['in_reply_to_status_id'];
- if($_POST['lat'] && $_POST['long'])
- $_POST['coord'] = sprintf("%s %s",$_POST['lat'],$_POST['long']);
+ $_POST['body'] = urldecode(requestdata('status'));
+ $_POST['parent'] = requestdata('in_reply_to_status_id');
+ if(requestdata('lat') && requestdata('long'))
+ $_POST['coord'] = sprintf("%s %s",requestdata('lat'),requestdata('long'));
$_POST['profile_uid'] = local_user();
- if($_POST['parent'])
+ if(requestdata('parent'))
$_POST['type'] = 'net-comment';
else
$_POST['type'] = 'wall';