some fixes to attachment output in feed

This commit is contained in:
Friendika 2011-04-06 20:03:06 -07:00
parent 6728a11ee3
commit 109c25a1bd
1 changed files with 3 additions and 3 deletions

View File

@ -1584,14 +1584,14 @@ function item_getfeedtags($item) {
} }
function item_getfeedattach($item) { function item_getfeedattach($item) {
$ret = array(); $ret = '';
$arr = explode(',',$item['attach']); $arr = explode(',',$item['attach']);
if(count($arr)) { if(count($arr)) {
foreach($arr as $r) { foreach($arr as $r) {
$matches = false; $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) { if($cnt) {
$ret .= '<link href="' . $matches[1] . '" type="' . $matches[3] . '" '; $ret .= '<link rel="enclosure" href="' . $matches[1] . '" type="' . $matches[3] . '" ';
if(intval($matches[2])) if(intval($matches[2]))
$ret .= 'size="' . intval($matches[2]) . '" '; $ret .= 'size="' . intval($matches[2]) . '" ';
if($matches[4] !== ' ') if($matches[4] !== ' ')