]> git.mxchange.org Git - friendica.git/blobdiff - boot.php
file attachments
[friendica.git] / boot.php
index b328eec0e6b15fbdfd6f0c0a6c7f66d6db69f621..25c7fd14d0cbc29919ebe00e8c21fbfe4dc8ac2c 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -6,7 +6,7 @@ ini_set('pcre.backtrack_limit', 250000);
 
 define ( 'FRIENDIKA_VERSION',      '2.2.990' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.21'    );
-define ( 'DB_UPDATE_VERSION',      1056      );
+define ( 'DB_UPDATE_VERSION',      1058      );
 
 define ( 'EOL',                    "<br />\r\n"     );
 define ( 'ATOM_TIME',              'Y-m-d\TH:i:s\Z' );
@@ -1983,15 +1983,15 @@ function get_tags($s) {
        $s = preg_replace('/\[code\](.*?)\[\/code\]/sm','',$s);
 
        if(preg_match_all('/([@#][^ \x0D\x0A,:?]+)([ \x0D\x0A,:?]|$)/',$s,$match)) {
-               foreach($match[1] as $match) {
-                       if(strstr($match,"]")) {
+               foreach($match[1] as $mtch) {
+                       if(strstr($mtch,"]")) {
                                // we might be inside a bbcode color tag - leave it alone
                                continue;
                        }
-                       if(substr($match,-1,1) === '.')
-                               $ret[] = substr($match,0,-1);
+                       if(substr($mtch,-1,1) === '.')
+                               $ret[] = substr($mtch,0,-1);
                        else
-                               $ret[] = $match;
+                               $ret[] = $mtch;
                }
        }
 
@@ -2547,6 +2547,7 @@ function prepare_body($item,$attach = false) {
                return $s;
 
        $arr = explode(',',$item['attach']);
+       $s .= '<div class="body-attach">';
        if(count($arr)) {
                foreach($arr as $r) {
                        $matches = false;
@@ -2559,7 +2560,7 @@ function prepare_body($item,$attach = false) {
                                        case 'audio':
                                        case 'image':
                                        case 'text':
-                                               $icon = '<div class="attachtype type-' . $attachtype . '"></div>';
+                                               $icon = '<div class="attachtype type-' . $icontype . '"></div>';
                                                break;
                                        default:
                                                $icon = '<div class="attachtype type-unkn"></div>';
@@ -2568,11 +2569,11 @@ function prepare_body($item,$attach = false) {
                                $title = ((strlen(trim($matches[4]))) ? escape_tags(trim($matches[4])) : escape_tags($matches[1]));
                                $title .= ' ' . $matches[2] . ' ' . t('bytes');
 
-                               $s .= '<a href="' . strip_tags($matches[1]) . '" title="' . $title . '" >' . $icon . '</a>';
+                               $s .= '<a href="' . strip_tags($matches[1]) . '" title="' . $title . '" class="attachlink" target="external-link" >' . $icon . '</a>';
                        }
                }
        }
-       $s .= '<div class="clear"></div>';
+       $s .= '<div class="clear"></div></div>';
        return $s;
 }}