Răsfoiți Sursa

Update SimplePie (PHP8) (#3206)

Contributes to https://github.com/FreshRSS/FreshRSS/issues/3082
Includes https://github.com/FreshRSS/FreshRSS/pull/3180
Differences:
https://github.com/simplepie/simplepie/compare/aaad78e6da098e14bec4fec552b3a2dbca7a2d45...692e8bc19bc4aca20b57474cca2a1d234ce89d63
Alexandre Alapetite 5 ani în urmă
părinte
comite
8ec2b257df

+ 3 - 3
lib/SimplePie/SimplePie.php

@@ -33,7 +33,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  *
  * @package SimplePie
- * @version 1.5.4
+ * @version 1.5.5
  * @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.4');
+define('SIMPLEPIE_VERSION', '1.5.5');
 
 /**
  * SimplePie Build
@@ -718,7 +718,7 @@ class SimplePie
 	 */
 	public function __destruct()
 	{
-		if ((version_compare(PHP_VERSION, '5.6', '<') || !gc_enabled()) && !ini_get('zend.ze1_compatibility_mode'))
+		if (!gc_enabled())
 		{
 			if (!empty($this->data['items']))
 			{

+ 0 - 5
lib/SimplePie/SimplePie/File.php

@@ -113,11 +113,6 @@ class SimplePie_File
 				curl_setopt($fp, CURLOPT_REFERER, SimplePie_Misc::url_remove_credentials($url));
 				curl_setopt($fp, CURLOPT_USERAGENT, $useragent);
 				curl_setopt($fp, CURLOPT_HTTPHEADER, $headers2);
-				//if (!ini_get('open_basedir') && !ini_get('safe_mode') && version_compare(SimplePie_Misc::get_curl_version(), '7.15.2', '>='))
-				//{
-				//	curl_setopt($fp, CURLOPT_FOLLOWLOCATION, 1);
-				//	curl_setopt($fp, CURLOPT_MAXREDIRS, $redirects);
-				//}
 				foreach ($curl_options as $curl_param => $curl_value) {
 					curl_setopt($fp, $curl_param, $curl_value);
 				}

+ 1 - 1
lib/SimplePie/SimplePie/Item.php

@@ -121,7 +121,7 @@ class SimplePie_Item
 	 */
 	public function __destruct()
 	{
-		if ((version_compare(PHP_VERSION, '5.6', '<') || !gc_enabled()) && !ini_get('zend.ze1_compatibility_mode'))
+		if (!gc_enabled())
 		{
 			unset($this->feed);
 		}

+ 1 - 1
lib/SimplePie/SimplePie/Locator.php

@@ -94,7 +94,7 @@ class SimplePie_Locator
 		$this->registry = $registry;
 	}
 
-	public function find($type = SIMPLEPIE_LOCATOR_ALL, &$working)
+	public function find($type = SIMPLEPIE_LOCATOR_ALL, &$working = null)
 	{
 		if ($this->is_feed($this->file))
 		{

+ 3 - 2
lib/SimplePie/SimplePie/Misc.php

@@ -368,11 +368,12 @@ class SimplePie_Misc
 		}
 
 		// Check that the encoding is supported
-		if (@mb_convert_encoding("\x80", 'UTF-16BE', $input) === "\x00\x80")
+		if (!in_array($input, mb_list_encodings()))
 		{
 			return false;
 		}
-		if (!in_array($input, mb_list_encodings()))
+
+		if (@mb_convert_encoding("\x80", 'UTF-16BE', $input) === "\x00\x80")
 		{
 			return false;
 		}