Explorar o código

SimplePie fix for Atom feeds using namespace for type (#1893)

https://github.com/FreshRSS/FreshRSS/issues/1892
Alexandre Alapetite %!s(int64=8) %!d(string=hai) anos
pai
achega
c96b5ff34a
Modificáronse 1 ficheiros con 10 adicións e 1 borrados
  1. 10 1
      lib/SimplePie/SimplePie/Misc.php

+ 10 - 1
lib/SimplePie/SimplePie/Misc.php

@@ -1928,9 +1928,18 @@ class SimplePie_Misc
 
 	public static function atom_10_content_construct_type($attribs)
 	{
+		$type = '';
 		if (isset($attribs['']['type']))
 		{
-			$type = strtolower(trim($attribs['']['type']));
+			$type = trim($attribs['']['type']);
+		}
+		elseif (isset($attribs[SIMPLEPIE_NAMESPACE_ATOM_10]['type']))
+		{//FreshRSS
+			$type = trim($attribs[SIMPLEPIE_NAMESPACE_ATOM_10]['type']);
+		}
+		if ($type != '')
+		{
+			$type = strtolower($type);
 			switch ($type)
 			{
 				case 'text':