aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/api.php25
-rw-r--r--include/attach.php2
-rw-r--r--include/photos.php2
3 files changed, 20 insertions, 9 deletions
diff --git a/include/api.php b/include/api.php
index 9c31f994f..f37e0669f 100644
--- a/include/api.php
+++ b/include/api.php
@@ -855,13 +855,24 @@ require_once('include/api_auth.php');
$_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_attach.php');
- $media = wall_attach_post($a);
- if(strlen($media)>0)
- $_REQUEST['body'] .= "\n\n".$media;
+ $num_uploads = count($_FILES['media']['name']);
+ for($x = 0; $x < $num_uploads; $x ++) {
+ $_FILES['userfile'] = array();
+ $_FILES['userfile']['name'] = $_FILES['media']['name'][$x];
+ $_FILES['userfile']['type'] = $_FILES['media']['type'][$x];
+ $_FILES['userfile']['tmp_name'] = $_FILES['media']['tmp_name'][$x];
+ $_FILES['userfile']['error'] = $_FILES['media']['error'][$x];
+ $_FILES['userfile']['size'] = $_FILES['media']['size'][$x];
+
+ // upload each image if we have any
+ $_REQUEST['silent']='1'; //tell wall_upload function to return img info instead of echo
+ require_once('mod/wall_attach.php');
+ $a->data['api_info'] = $user_info;
+ $media = wall_attach_post($a);
+
+ if(strlen($media)>0)
+ $_REQUEST['body'] .= "\n\n" . $media;
+ }
}
}
diff --git a/include/attach.php b/include/attach.php
index 36b971712..20e8b7444 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -430,7 +430,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
$observer = $x[0];
}
- logger('arr: ' . print_r($arr,true));
+ logger('arr: ' . print_r($arr,true), LOGGER_DATA);
if(! perm_is_allowed($channel_id,$observer_hash, 'write_storage')) {
$ret['message'] = t('Permission denied.');
diff --git a/include/photos.php b/include/photos.php
index c7360a956..798b89b54 100644
--- a/include/photos.php
+++ b/include/photos.php
@@ -377,7 +377,7 @@ function photo_upload($channel, $observer, $args) {
$arr['item_thread_top'] = 1;
$arr['item_private'] = intval($acl->is_private());
$arr['plink'] = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . $arr['mid'];
- $arr['body'] = (($object) ? $args['body'] : $body . "\r\n" . $args['body']);
+ $arr['body'] = (($args['body']) ? $body . "\r\n" . $args['body'] : $body);
// this one is tricky because the item and the photo have the same permissions, those of the photo.