aboutsummaryrefslogtreecommitdiffstats
path: root/lib/simplepie/library/SimplePie.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/simplepie/library/SimplePie.php')
-rwxr-xr-xlib/simplepie/library/SimplePie.php42
1 files changed, 33 insertions, 9 deletions
diff --git a/lib/simplepie/library/SimplePie.php b/lib/simplepie/library/SimplePie.php
index d4c2f0f1d..2ae78c359 100755
--- a/lib/simplepie/library/SimplePie.php
+++ b/lib/simplepie/library/SimplePie.php
@@ -33,7 +33,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* @package SimplePie
- * @version 1.5.6
+ * @version 1.6.0
* @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.6');
+define('SIMPLEPIE_VERSION', '1.6.0');
/**
* SimplePie Build
@@ -651,6 +651,13 @@ class SimplePie
public $strip_htmltags = array('base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style');
/**
+ * @var array Stores the default attributes to be renamed by rename_attributes().
+ * @see SimplePie::rename_attributes()
+ * @access private
+ */
+ public $rename_attributes = array();
+
+ /**
* @var bool Should we throw exceptions, or use the old-style error property?
* @access private
*/
@@ -1223,6 +1230,15 @@ class SimplePie
$this->sanitize->encode_instead_of_strip($enable);
}
+ public function rename_attributes($attribs = '')
+ {
+ if ($attribs === '')
+ {
+ $attribs = $this->rename_attributes;
+ }
+ $this->sanitize->rename_attributes($attribs);
+ }
+
public function strip_attributes($attribs = '')
{
if ($attribs === '')
@@ -1785,7 +1801,7 @@ class SimplePie
}
/**
- * Get the error message for the occured error
+ * Get the error message for the occurred error
*
* @return string|array Error message, or array of messages for multifeeds
*/
@@ -2199,7 +2215,7 @@ class SimplePie
*/
public function get_base($element = array())
{
- if (!($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION) && !empty($element['xml_base_explicit']) && isset($element['xml_base']))
+ if (!empty($element['xml_base_explicit']) && isset($element['xml_base']))
{
return $element['xml_base'];
}
@@ -2647,13 +2663,19 @@ class SimplePie
}
}
- if (isset($this->data['headers']['link']) &&
- preg_match('/<([^>]+)>; rel='.preg_quote($rel).'/',
- $this->data['headers']['link'], $match))
+ if (isset($this->data['headers']['link']))
{
- return array($match[1]);
+ $link_headers = $this->data['headers']['link'];
+ if (is_string($link_headers)) {
+ $link_headers = array($link_headers);
+ }
+ $matches = preg_filter('/<([^>]+)>; rel='.preg_quote($rel).'/', '$1', $link_headers);
+ if (!empty($matches)) {
+ return $matches;
+ }
}
- else if (isset($this->data['links'][$rel]))
+
+ if (isset($this->data['links'][$rel]))
{
return $this->data['links'][$rel];
}
@@ -3310,3 +3332,5 @@ class SimplePie
}
}
}
+
+class_alias('SimplePie', 'SimplePie\SimplePie', false);