Skip to content
Snippets Groups Projects
Commit 7b64efbc authored by Alex Barth's avatar Alex Barth
Browse files

#887846 ekes: Make FeedsSimplePieEnclosure (un)serialization safe.

parent feaf0c62
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@
Feeds 6.x xxxxxxxxxxxxxxxxxxxxxx
--------------------------------
- #887846 ekes: Make FeedsSimplePieEnclosure (un)serialization safe.
- #908582 XiaN Vizjereij, alex_b: Fix "Cannot use object of type stdClass as
array" error in mappers/taxonomy.inc.
- #906654 alex_b: Fix phantom subscriptions.
......
......@@ -6,6 +6,7 @@
*/
class FeedsSimplePieEnclosure extends FeedsEnclosure {
protected $simplepie_enclosure;
private $_serialized_simplepie_enclosure;
/**
* Constructor requires SimplePie enclosure object.
......@@ -14,6 +15,26 @@ class FeedsSimplePieEnclosure extends FeedsEnclosure {
$this->simplepie_enclosure = $enclosure;
}
/**
* Serialization helper.
*
* Handle the simplepie enclosure class seperately ourselves.
*/
public function __sleep() {
$this->_serialized_simplepie_enclosure = serialize($this->simplepie_enclosure);
return array('_serialized_simplepie_enclosure');
}
/**
* Unserialization helper.
*
* Ensure that the simplepie class definitions are loaded for the enclosure when unserializing.
*/
public function __wakeup() {
feeds_include_library('simplepie.inc', 'simplepie');
$this->simplepie_enclosure = unserialize($this->_serialized_simplepie_enclosure);
}
/**
* Override parent::getValue().
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment