diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-06-10 17:45:04 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-06-10 17:45:04 -0700 |
commit | 04551ac32b171ce49eac64cee0eca719d8e2f58a (patch) | |
tree | e924bc807bafeaca52554ae9c680755b169d59b5 /mod/item.php | |
parent | 9a5d9fb8c59b04ef64151d1d038dc2659898d295 (diff) | |
parent | 52ddbd1adda88690a19aafc35e455b01d059852f (diff) | |
download | volse-hubzilla-04551ac32b171ce49eac64cee0eca719d8e2f58a.tar.gz volse-hubzilla-04551ac32b171ce49eac64cee0eca719d8e2f58a.tar.bz2 volse-hubzilla-04551ac32b171ce49eac64cee0eca719d8e2f58a.zip |
Merge https://github.com/redmatrix/redmatrix into pending_merge
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 a9c6ea65b..3ff286268 100644 --- a/mod/item.php +++ b/mod/item.php @@ -586,27 +586,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); - } - } /** * @@ -643,6 +622,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 |