aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2015-12-02 11:34:40 +0100
committerMario Vavti <mario@mariovavti.com>2015-12-02 11:34:40 +0100
commitbb995f1bb6996990da2a5a657ba3887fd5a14097 (patch)
tree5b947ce8c157f3c7fbf39ac7e75855a75cd93b88
parent857e13e9b8ee4fe2c27cd9737f0396cb669cb8ad (diff)
downloadvolse-hubzilla-bb995f1bb6996990da2a5a657ba3887fd5a14097.tar.gz
volse-hubzilla-bb995f1bb6996990da2a5a657ba3887fd5a14097.tar.bz2
volse-hubzilla-bb995f1bb6996990da2a5a657ba3887fd5a14097.zip
fix mail attachment and photo permissions. issue #202
-rw-r--r--include/message.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/message.php b/include/message.php
index 169f394d9..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;
@@ -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,','));