diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-06-10 15:47:23 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-06-10 15:47:23 -0700 |
commit | 2128d5a2560383e0d3587087a7dd0aab217bc262 (patch) | |
tree | c2aa27a08a9e96ecf291d10db46e4fcf0e3806c9 /mod/item.php | |
parent | eb6a1f838724504f0034d51a28567ea9a8119b54 (diff) | |
parent | 52ddbd1adda88690a19aafc35e455b01d059852f (diff) | |
download | volse-hubzilla-2128d5a2560383e0d3587087a7dd0aab217bc262.tar.gz volse-hubzilla-2128d5a2560383e0d3587087a7dd0aab217bc262.tar.bz2 volse-hubzilla-2128d5a2560383e0d3587087a7dd0aab217bc262.zip |
Merge branch 'master' of https://github.com/redmatrix/redmatrix
Diffstat (limited to 'mod/item.php')
-rw-r--r-- | mod/item.php | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/mod/item.php b/mod/item.php index 94b32d01c..d631bd1f2 100644 --- a/mod/item.php +++ b/mod/item.php @@ -581,27 +581,6 @@ function item_post(&$a) { } } - $attachments = ''; - $match = false; - - if(preg_match_all('/(\[attachment\](.*?)\[\/attachment\])/',$body,$match)) { - $attachments = array(); - foreach($match[2] as $mtch) { - $hash = substr($mtch,0,strpos($mtch,',')); - $rev = intval(substr($mtch,strpos($mtch,','))); - $r = attach_by_hash_nodata($hash,$rev); - if($r['success']) { - $attachments[] = array( - 'href' => $a->get_baseurl() . '/attach/' . $r['data']['hash'], - 'length' => $r['data']['filesize'], - 'type' => $r['data']['filetype'], - 'title' => urlencode($r['data']['filename']), - 'revision' => $r['data']['revision'] - ); - } - $body = str_replace($match[1],'',$body); - } - } /** * @@ -638,6 +617,29 @@ function item_post(&$a) { } + + $attachments = ''; + $match = false; + + if(preg_match_all('/(\[attachment\](.*?)\[\/attachment\])/',$body,$match)) { + $attachments = array(); + foreach($match[2] as $mtch) { + $hash = substr($mtch,0,strpos($mtch,',')); + $rev = intval(substr($mtch,strpos($mtch,','))); + $r = attach_by_hash_nodata($hash,$rev); + if($r['success']) { + $attachments[] = array( + 'href' => $a->get_baseurl() . '/attach/' . $r['data']['hash'], + 'length' => $r['data']['filesize'], + 'type' => $r['data']['filetype'], + 'title' => urlencode($r['data']['filename']), + 'revision' => $r['data']['revision'] + ); + } + $body = str_replace($match[1],'',$body); + } + } + } // BBCODE end alert |