diff options
author | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2015-12-03 18:14:52 +0100 |
---|---|---|
committer | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2015-12-03 18:14:52 +0100 |
commit | c363fc71eb054ffa615bdfe03c645a9ab946379e (patch) | |
tree | 564dbaa2dac8bb13260704730a8e5483084baa67 /include/message.php | |
parent | b96f09bb3aeee403038755ab5f6e6b53654cb145 (diff) | |
parent | 9f3ea71d5d9e1e42d1d1e44a8070d90814962ad2 (diff) | |
download | volse-hubzilla-c363fc71eb054ffa615bdfe03c645a9ab946379e.tar.gz volse-hubzilla-c363fc71eb054ffa615bdfe03c645a9ab946379e.tar.bz2 volse-hubzilla-c363fc71eb054ffa615bdfe03c645a9ab946379e.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include/message.php')
-rw-r--r-- | include/message.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/include/message.php b/include/message.php index 820d814b6..6a9e8328a 100644 --- a/include/message.php +++ b/include/message.php @@ -13,6 +13,7 @@ function send_message($uid = 0, $recipient='', $body='', $subject='', $replyto=' $ret = array('success' => false); $a = get_app(); + $observer_hash = get_observer_hash(); if(! $recipient) { $ret['message'] = t('No recipient provided.'); @@ -148,8 +149,8 @@ function send_message($uid = 0, $recipient='', $body='', $subject='', $replyto=' $match = null; $images = null; - if(preg_match_all("/\[zmg\](.*?)\[\/zmg\]/",((strpos($body,'[/crypt]')) ? $_POST['media_str'] : $body),$match)) - $images = $match[1]; + if(preg_match_all("/\[zmg\=([0-9]*)x([0-9]*)\](.*?)\[\/zmg\]/",((strpos($body,'[/crypt]')) ? $_POST['media_str'] : $body),$match)) + $images = $match[3]; $match = false; @@ -173,7 +174,7 @@ function send_message($uid = 0, $recipient='', $body='', $subject='', $replyto=' 'revision' => $r['data']['revision'] ); } - $body = str_replace($match[1],'',$body); + $body = trim(str_replace($match[1],'',$body)); } } @@ -230,7 +231,7 @@ function send_message($uid = 0, $recipient='', $body='', $subject='', $replyto=' dbesc($image_uri), intval($channel['channel_id']), dbesc('<' . $channel['channel_hash'] . '>') - ); + ); $r = q("UPDATE attach SET allow_cid = '%s' WHERE hash = '%s' AND is_photo = 1 and uid = %d and allow_cid = '%s'", dbesc('<' . $recipient . '>'), dbesc($image_uri), @@ -239,7 +240,7 @@ function send_message($uid = 0, $recipient='', $body='', $subject='', $replyto=' ); } } - + if($attaches) { foreach($attaches as $attach) { $hash = substr($attach,0,strpos($attach,',')); |