Explorar o código

Merge branch 'patch-2' of https://github.com/Alkarex/FreshRSS into Alkarex-patch-2

Marien Fressinaud %!s(int64=12) %!d(string=hai) anos
pai
achega
ce1101bf45
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      app/models/Feed.php

+ 10 - 0
app/models/Feed.php

@@ -246,6 +246,16 @@ class Feed extends Model {
 			}
 
 			$content = $item->get_content ();
+			$elinks = array();
+			foreach ($item->get_enclosures() as $enclosure) {
+				$elink = $enclosure->get_link();
+				if (array_key_exists($elink, $elinks)) continue;
+				$elinks[$elink] = '1';
+				$mime = strtolower($enclosure->get_type());
+				if (strpos($mime, 'image/') === 0) {
+					$content .= '<br /><img src="' . $elink . '" />';
+				}
+			}
 
 			$entry = new Entry (
 				$this->id (),