aboutsummaryrefslogtreecommitdiffstats
path: root/include/api.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-07-25 05:04:52 -0700
committerfriendica <info@friendica.com>2013-07-25 05:04:52 -0700
commite45beccd5b7f5f56f3bda9f09e77e4c0f9669fcd (patch)
tree41eeb9ad689e5a4b38384b5e195429f70126a022 /include/api.php
parent98d3d06352f1a2f0d1220bb6f1b4a031c4c885d1 (diff)
downloadvolse-hubzilla-e45beccd5b7f5f56f3bda9f09e77e4c0f9669fcd.tar.gz
volse-hubzilla-e45beccd5b7f5f56f3bda9f09e77e4c0f9669fcd.tar.bz2
volse-hubzilla-e45beccd5b7f5f56f3bda9f09e77e4c0f9669fcd.zip
fix media uploads in api (specifically friendica for android)
Diffstat (limited to 'include/api.php')
-rw-r--r--include/api.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/api.php b/include/api.php
index ac86178a6..a49258d18 100644
--- a/include/api.php
+++ b/include/api.php
@@ -610,6 +610,15 @@ require_once('include/photos.php');
return false;
}
+ logger('api_statuses_update: REQUEST ' . print_r($_REQUEST,true));
+ logger('api_statuses_update: FILES ' . print_r($_FILES,true));
+
+
+ // set this so that the item_post() function is quiet and doesn't redirect or emit json
+
+ $_REQUEST['api_source'] = true;
+
+
$user_info = api_get_user($a);
// convert $_POST array items to the form we use for web posts.
@@ -655,7 +664,9 @@ require_once('include/photos.php');
$_REQUEST['type'] = 'net-comment';
else {
$_REQUEST['type'] = 'wall';
+
if(x($_FILES,'media')) {
+ $_FILES['userfile'] = $_FILES['media'];
// upload the image if we have one
$_REQUEST['silent']='1'; //tell wall_upload function to return img info instead of echo
require_once('mod/wall_upload.php');
@@ -665,9 +676,6 @@ require_once('include/photos.php');
}
}
- // set this so that the item_post() function is quiet and doesn't redirect or emit json
-
- $_REQUEST['api_source'] = true;
// call out normal post function