Skip to content

Commit d12ad50

Browse files
committed
External Libraries: Update the SimplePie library to the latest version (1.5.5).
This brings SimplePie in sync with the most up to date version, 1.5.5. This update brings many bug fixes, small enhancements, and PHP compatibility fixes for newer versions of PHP. For a full list of changes, see https://github.com/simplepie/simplepie/blob/master/CHANGELOG.md#155-may-1-2020. Props dshanske, slushman, etruel, wpshades, dmenard, desrosj, hareesh-pillai, stevenkword, jrf, Ipstenu, johnbillion. Fixes #36669. git-svn-id: https://develop.svn.wordpress.org/trunk@47733 602fd350-edb4-49c9-b593-d223f7449a82
1 parent aef50f9 commit d12ad50

35 files changed

Lines changed: 1986 additions & 1238 deletions

src/wp-includes/SimplePie/Author.php

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* A PHP-Based RSS and Atom Feed Framework.
66
* Takes the hard work out of managing a complete RSS/Atom solution.
77
*
8-
* Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors
8+
* Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
99
* All rights reserved.
1010
*
1111
* Redistribution and use in source and binary forms, with or without modification, are
@@ -33,10 +33,9 @@
3333
* POSSIBILITY OF SUCH DAMAGE.
3434
*
3535
* @package SimplePie
36-
* @version 1.3.1
37-
* @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue
36+
* @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
3837
* @author Ryan Parman
39-
* @author Geoffrey Sneddon
38+
* @author Sam Sneddon
4039
* @author Ryan McCue
4140
* @link http://simplepie.org/ SimplePie
4241
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
@@ -114,10 +113,8 @@ public function get_name()
114113
{
115114
return $this->name;
116115
}
117-
else
118-
{
119-
return null;
120-
}
116+
117+
return null;
121118
}
122119

123120
/**
@@ -131,10 +128,8 @@ public function get_link()
131128
{
132129
return $this->link;
133130
}
134-
else
135-
{
136-
return null;
137-
}
131+
132+
return null;
138133
}
139134

140135
/**
@@ -148,10 +143,7 @@ public function get_email()
148143
{
149144
return $this->email;
150145
}
151-
else
152-
{
153-
return null;
154-
}
146+
147+
return null;
155148
}
156149
}
157-

src/wp-includes/SimplePie/Cache.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* A PHP-Based RSS and Atom Feed Framework.
66
* Takes the hard work out of managing a complete RSS/Atom solution.
77
*
8-
* Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors
8+
* Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
99
* All rights reserved.
1010
*
1111
* Redistribution and use in source and binary forms, with or without modification, are
@@ -33,10 +33,9 @@
3333
* POSSIBILITY OF SUCH DAMAGE.
3434
*
3535
* @package SimplePie
36-
* @version 1.3.1
37-
* @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue
36+
* @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
3837
* @author Ryan Parman
39-
* @author Geoffrey Sneddon
38+
* @author Sam Sneddon
4039
* @author Ryan McCue
4140
* @link http://simplepie.org/ SimplePie
4241
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
@@ -62,8 +61,10 @@ class SimplePie_Cache
6261
* @var array
6362
*/
6463
protected static $handlers = array(
65-
'mysql' => 'SimplePie_Cache_MySQL',
66-
'memcache' => 'SimplePie_Cache_Memcache',
64+
'mysql' => 'SimplePie_Cache_MySQL',
65+
'memcache' => 'SimplePie_Cache_Memcache',
66+
'memcached' => 'SimplePie_Cache_Memcached',
67+
'redis' => 'SimplePie_Cache_Redis'
6768
);
6869

6970
/**

src/wp-includes/SimplePie/Cache/Base.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* A PHP-Based RSS and Atom Feed Framework.
66
* Takes the hard work out of managing a complete RSS/Atom solution.
77
*
8-
* Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors
8+
* Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
99
* All rights reserved.
1010
*
1111
* Redistribution and use in source and binary forms, with or without modification, are
@@ -33,10 +33,9 @@
3333
* POSSIBILITY OF SUCH DAMAGE.
3434
*
3535
* @package SimplePie
36-
* @version 1.3.1
37-
* @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue
36+
* @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
3837
* @author Ryan Parman
39-
* @author Geoffrey Sneddon
38+
* @author Sam Sneddon
4039
* @author Ryan McCue
4140
* @link http://simplepie.org/ SimplePie
4241
* @license http://www.opensource.org/licenses/bsd-license.php BSD License

src/wp-includes/SimplePie/Cache/DB.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* A PHP-Based RSS and Atom Feed Framework.
66
* Takes the hard work out of managing a complete RSS/Atom solution.
77
*
8-
* Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors
8+
* Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
99
* All rights reserved.
1010
*
1111
* Redistribution and use in source and binary forms, with or without modification, are
@@ -33,10 +33,9 @@
3333
* POSSIBILITY OF SUCH DAMAGE.
3434
*
3535
* @package SimplePie
36-
* @version 1.3.1
37-
* @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue
36+
* @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
3837
* @author Ryan Parman
39-
* @author Geoffrey Sneddon
38+
* @author Sam Sneddon
4039
* @author Ryan McCue
4140
* @link http://simplepie.org/ SimplePie
4241
* @license http://www.opensource.org/licenses/bsd-license.php BSD License

src/wp-includes/SimplePie/Cache/File.php

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* A PHP-Based RSS and Atom Feed Framework.
66
* Takes the hard work out of managing a complete RSS/Atom solution.
77
*
8-
* Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors
8+
* Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
99
* All rights reserved.
1010
*
1111
* Redistribution and use in source and binary forms, with or without modification, are
@@ -33,10 +33,9 @@
3333
* POSSIBILITY OF SUCH DAMAGE.
3434
*
3535
* @package SimplePie
36-
* @version 1.3.1
37-
* @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue
36+
* @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
3837
* @author Ryan Parman
39-
* @author Geoffrey Sneddon
38+
* @author Sam Sneddon
4039
* @author Ryan McCue
4140
* @link http://simplepie.org/ SimplePie
4241
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
@@ -102,7 +101,7 @@ public function __construct($location, $name, $type)
102101
*/
103102
public function save($data)
104103
{
105-
if (file_exists($this->name) && is_writeable($this->name) || file_exists($this->location) && is_writeable($this->location))
104+
if (file_exists($this->name) && is_writable($this->name) || file_exists($this->location) && is_writable($this->location))
106105
{
107106
if ($data instanceof SimplePie)
108107
{
@@ -136,11 +135,7 @@ public function load()
136135
*/
137136
public function mtime()
138137
{
139-
if (file_exists($this->name))
140-
{
141-
return filemtime($this->name);
142-
}
143-
return false;
138+
return @filemtime($this->name);
144139
}
145140

146141
/**
@@ -150,11 +145,7 @@ public function mtime()
150145
*/
151146
public function touch()
152147
{
153-
if (file_exists($this->name))
154-
{
155-
return touch($this->name);
156-
}
157-
return false;
148+
return @touch($this->name);
158149
}
159150

160151
/**

src/wp-includes/SimplePie/Cache/Memcache.php

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* A PHP-Based RSS and Atom Feed Framework.
66
* Takes the hard work out of managing a complete RSS/Atom solution.
77
*
8-
* Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors
8+
* Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
99
* All rights reserved.
1010
*
1111
* Redistribution and use in source and binary forms, with or without modification, are
@@ -33,10 +33,9 @@
3333
* POSSIBILITY OF SUCH DAMAGE.
3434
*
3535
* @package SimplePie
36-
* @version 1.3.1
37-
* @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue
36+
* @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
3837
* @author Ryan Parman
39-
* @author Geoffrey Sneddon
38+
* @author Sam Sneddon
4039
* @author Ryan McCue
4140
* @link http://simplepie.org/ SimplePie
4241
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
@@ -95,10 +94,8 @@ public function __construct($location, $name, $type)
9594
'prefix' => 'simplepie_',
9695
),
9796
);
98-
$parsed = SimplePie_Cache::parse_URL($location);
99-
$this->options['host'] = empty($parsed['host']) ? $this->options['host'] : $parsed['host'];
100-
$this->options['port'] = empty($parsed['port']) ? $this->options['port'] : $parsed['port'];
101-
$this->options['extras'] = array_merge($this->options['extras'], $parsed['extras']);
97+
$this->options = SimplePie_Misc::array_merge_recursive($this->options, SimplePie_Cache::parse_URL($location));
98+
10299
$this->name = $this->options['extras']['prefix'] . md5("$name:$type");
103100

104101
$this->cache = new Memcache();
@@ -147,7 +144,7 @@ public function mtime()
147144

148145
if ($data !== false)
149146
{
150-
// essentially ignore the mtime because Memcache expires on it's own
147+
// essentially ignore the mtime because Memcache expires on its own
151148
return time();
152149
}
153150

@@ -165,7 +162,7 @@ public function touch()
165162

166163
if ($data !== false)
167164
{
168-
return $this->cache->set($this->name, $data, MEMCACHE_COMPRESSED, (int) $this->duration);
165+
return $this->cache->set($this->name, $data, MEMCACHE_COMPRESSED, (int) $this->options['extras']['timeout']);
169166
}
170167

171168
return false;

0 commit comments

Comments
 (0)