Skip to content

Commit

Permalink
FIX: #416
Browse files Browse the repository at this point in the history
  • Loading branch information
tontof committed Nov 25, 2019
1 parent af18265 commit 321db1b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
14 changes: 11 additions & 3 deletions index.php
Expand Up @@ -2,7 +2,7 @@
// KrISS feed: a simple and smart (or stupid) feed reader
// Copyleft (ɔ) - Tontof - http://tontof.net
// use KrISS feed at your own risk
define('FEED_VERSION', 8.8);
define('FEED_VERSION', 8.9);

define('DATA_DIR', 'data');
define('INC_DIR', 'inc');
Expand Down Expand Up @@ -796,9 +796,12 @@ public function updateItemsFromDom($dom) {
);
if(!empty($item['enclosure'])) {
foreach($item['enclosure'] as $enclosure) {
$item['content'] .= '<br>'.$this->showEnclosure($enclosure);
$item['content'] .= '<br><br>'.$this->showEnclosure($enclosure);
}
}
if(!empty($item['thumbnail'])) {
$item['content'] .= '<br>'.$this->showEnclosure($item['thumbnail']);
}
$newItems[$hashUrl]['content'] = $item['content'];
}
}
Expand Down Expand Up @@ -4695,7 +4698,8 @@ class Rss
'link' => array('>feedburner:origLink', '>link[rel=alternate][href]', '>link[href]', '>link', '>guid', '>id'),
'time' => array('>pubDate', '>updated', '>lastBuildDate', '>published', '>dc:date', '>date', '>created', '>modified'),
'title' => array('>title'),
'enclosure' => array('>enclosure*[url]', '>media:group>media:content*[url]')
'enclosure' => array('>enclosure*[url]', '>media:group>media:content*[url]'),
'thumbnail' => array('>media:thumbnail[url]'),
);

public static function isValidNodeAttrs($node, $attrs)
Expand Down Expand Up @@ -4778,6 +4782,10 @@ public static function getElement($node, $selectors)
}
}

if ($name == "media:description") {
$res = nl2br($res);
}

return $res;
}

Expand Down
5 changes: 4 additions & 1 deletion src/class/Feed.php
Expand Up @@ -955,9 +955,12 @@ public function updateItemsFromDom($dom) {
);
if(!empty($item['enclosure'])) {
foreach($item['enclosure'] as $enclosure) {
$item['content'] .= '<br>'.$this->showEnclosure($enclosure);
$item['content'] .= '<br><br>'.$this->showEnclosure($enclosure);
}
}
if(!empty($item['thumbnail'])) {
$item['content'] .= '<br>'.$this->showEnclosure($item['thumbnail']);
}
$newItems[$hashUrl]['content'] = $item['content'];
}
}
Expand Down
7 changes: 6 additions & 1 deletion src/class/Rss.php
Expand Up @@ -32,7 +32,8 @@ class Rss
'link' => array('>feedburner:origLink', '>link[rel=alternate][href]', '>link[href]', '>link', '>guid', '>id'),
'time' => array('>pubDate', '>updated', '>lastBuildDate', '>published', '>dc:date', '>date', '>created', '>modified'),
'title' => array('>title'),
'enclosure' => array('>enclosure*[url]', '>media:group>media:content*[url]')
'enclosure' => array('>enclosure*[url]', '>media:group>media:content*[url]'),
'thumbnail' => array('>media:thumbnail[url]'),
);

/**
Expand Down Expand Up @@ -147,6 +148,10 @@ public static function getElement($node, $selectors)
}
}

if ($name == "media:description") {
$res = nl2br($res);
}

return $res;
}

Expand Down
2 changes: 1 addition & 1 deletion src/kriss_feed.php
Expand Up @@ -2,7 +2,7 @@
// KrISS feed: a simple and smart (or stupid) feed reader
// Copyleft (ɔ) - Tontof - http://tontof.net
// use KrISS feed at your own risk
define('FEED_VERSION', 8.8);
define('FEED_VERSION', 8.9);

define('DATA_DIR', 'data');
define('INC_DIR', 'inc');
Expand Down

0 comments on commit 321db1b

Please sign in to comment.