]> git.mxchange.org Git - friendica.git/blobdiff - include/items.php
Merge branch 'opensearch' of https://github.com/fabrixxm/friendika into fabrixxm...
[friendica.git] / include / items.php
index 501f2f94478717ecdd92d19aae01de43d06b0cac..5969466813a0d1b406a8319c3802abfc4ef6a007 100644 (file)
@@ -653,6 +653,7 @@ function item_store($arr,$force_parent = false) {
        $arr['private']       = ((x($arr,'private'))       ? intval($arr['private'])             : 0 );
        $arr['body']          = ((x($arr,'body'))          ? trim($arr['body'])                  : '');
        $arr['tag']           = ((x($arr,'tag'))           ? notags(trim($arr['tag']))           : '');
+       $arr['attach']        = ((x($arr,'attach'))        ? notags(trim($arr['attach']))        : '');
 
        if($arr['parent-uri'] === $arr['uri']) {
                $parent_id = 0;
@@ -1584,18 +1585,18 @@ function item_getfeedtags($item) {
 }
 
 function item_getfeedattach($item) {
-       $ret = array();
+       $ret = '';
        $arr = explode(',',$item['attach']);
        if(count($arr)) {
                foreach($arr as $r) {
                        $matches = false;
-                       $cnt = preg_match('|\<a href=\"(.+?)\" size=\"(.+?)\" type=\"(.+?)\" >(.+?)</a>|',$item['attach'],$matches);
+                       $cnt = preg_match('|\<a href=\"(.+?)\" size=\"(.+?)\" type=\"(.+?)\" >(.+?)</a>|',$r,$matches);
                        if($cnt) {
-                               $ret .= '<link href="' . $matches[1] . '" type="' . $matches[3] . '" ';
+                               $ret .= '<link rel="enclosure" href="' . xmlify($matches[1]) . '" type="' . xmlify($matches[3]) . '" ';
                                if(intval($matches[2]))
                                        $ret .= 'size="' . intval($matches[2]) . '" ';
                                if($matches[4] !== ' ')
-                                       $ret .= 'title="' . $matches[4] . '" ';
+                                       $ret .= 'title="' . xmlify($matches[4]) . '" ';
                                $ret .= ' />' . "\r\n";
                        }
                }