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
692e8bc19b...155cfcfacd
Related to https://github.com/FreshRSS/FreshRSS/pull/3416 ,
https://github.com/FreshRSS/FreshRSS/pull/3404

* Typo
This commit is contained in:
Alexandre Alapetite
2021-02-20 23:38:36 +01:00
committed by GitHub
parent ae5f4601fd
commit 75711c3647
3 changed files with 6 additions and 5 deletions

View File

@@ -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))

View File

@@ -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';

View File

@@ -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))
{