Explorar o código

Manual update to SimplePie 1.5.6 (#3469)

* Manual update to SimplePie 1.5.6

Follow-up of https://github.com/FreshRSS/FreshRSS/pull/3206 (1.5.5)
Differences
https://github.com/simplepie/simplepie/compare/692e8bc19bc4aca20b57474cca2a1d234ce89d63...155cfcfacdbf7ee4e9cbb837e70564cdd6a40ac0
Related to https://github.com/FreshRSS/FreshRSS/pull/3416 ,
https://github.com/FreshRSS/FreshRSS/pull/3404

* Typo
Alexandre Alapetite %!s(int64=5) %!d(string=hai) anos
pai
achega
75711c3647

+ 3 - 3
lib/SimplePie/SimplePie.php

@@ -33,7 +33,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  *
  * @package SimplePie
- * @version 1.5.5
+ * @version 1.5.6
  * @copyright 2004-2017 Ryan Parman, Sam Sneddon, Ryan McCue
  * @author Ryan Parman
  * @author Sam Sneddon
@@ -50,7 +50,7 @@ define('SIMPLEPIE_NAME', 'SimplePie');
 /**
  * SimplePie Version
  */
-define('SIMPLEPIE_VERSION', '1.5.5');
+define('SIMPLEPIE_VERSION', '1.5.6');
 
 /**
  * SimplePie Build
@@ -1521,7 +1521,7 @@ class SimplePie
 				$parser = $this->registry->create('Parser');
 
 				// If it's parsed fine
-				if ($parser->parse($utf8_data, empty($encoding) ? '' : 'UTF-8'))	//FreshRSS
+				if ($parser->parse($utf8_data, empty($encoding) ? '' : 'UTF-8', $this->permanent_url))	//FreshRSS
 				{
 					$this->data = $parser->get_data();
 					if (!($this->get_type() & ~SIMPLEPIE_TYPE_NONE))

+ 1 - 1
lib/SimplePie/SimplePie/Content/Type/Sniffer.php

@@ -150,7 +150,7 @@ class SimplePie_Content_Type_Sniffer
 		}
 		elseif (preg_match('/[\x00-\x08\x0E-\x1A\x1C-\x1F]/', $this->file->body))
 		{
-			return 'application/octect-stream';
+			return 'application/octet-stream';
 		}
 
 		return 'text/plain';

+ 2 - 1
lib/SimplePie/SimplePie/Parser.php

@@ -181,7 +181,8 @@ class SimplePie_Parser
 			xml_set_element_handler($xml, 'tag_open', 'tag_close');
 
 			// Parse!
-			if (($stream = fopen('php://temp', 'r+')) &&
+			$wrapper = @is_writable(sys_get_temp_dir()) ? 'php://temp' : 'php://memory';
+			if (($stream = fopen($wrapper, 'r+')) &&
 				fwrite($stream, $data) &&
 				rewind($stream))
 			{