diff options
author | Mario Vavti <mario@mariovavti.com> | 2015-10-29 19:46:21 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2015-10-29 19:46:21 +0100 |
commit | c5aedb14a962290140b1f2b7cc1d2b62296c7624 (patch) | |
tree | e638b3ad0b5ba08f1be94502276bc85c24806f80 /mod/item.php | |
parent | ec28dee728b847f2363a53fb11e003d818c8e1cb (diff) | |
download | volse-hubzilla-c5aedb14a962290140b1f2b7cc1d2b62296c7624.tar.gz volse-hubzilla-c5aedb14a962290140b1f2b7cc1d2b62296c7624.tar.bz2 volse-hubzilla-c5aedb14a962290140b1f2b7cc1d2b62296c7624.zip |
fix #83
Diffstat (limited to 'mod/item.php')
-rw-r--r-- | mod/item.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mod/item.php b/mod/item.php index 4dcf8edd7..591dc8407 100644 --- a/mod/item.php +++ b/mod/item.php @@ -607,6 +607,7 @@ function item_post(&$a) { if(preg_match_all('/(\[attachment\](.*?)\[\/attachment\])/',$body,$match)) { $attachments = array(); + $i = 0; foreach($match[2] as $mtch) { $attach_link = ''; $hash = substr($mtch,0,strpos($mtch,',')); @@ -626,7 +627,8 @@ function item_post(&$a) { $attach_link = '[audio]' . z_root() . '/attach/' . $r['data']['hash'] . '/' . $r['data']['revision'] . (($ext) ? $ext : '') . '[/audio]'; elseif(strpos($r['data']['filetype'],'video/') !== false) $attach_link = '[video]' . z_root() . '/attach/' . $r['data']['hash'] . '/' . $r['data']['revision'] . (($ext) ? $ext : '') . '[/video]'; - $body = str_replace($match[1],$attach_link,$body); + $body = str_replace($match[1][$i],$attach_link,$body); + $i++; } } |