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

#736684 Souvent22, Mixologic: FeedsDateTime & Batch DateTime causes core dumps.

parent 9c174fc3
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
Feeds 6.x 1.0 xxxxx xx, 2010-xx-xx Feeds 6.x 1.0 xxxxx xx, 2010-xx-xx
---------------------------------- ----------------------------------
- #736684 Souvent22, Mixologic: FeedsDateTime & Batch DateTime causes core
dumps.
- #750168 jtr: _parser_common_syndication_title does not strip html tags before - #750168 jtr: _parser_common_syndication_title does not strip html tags before
constructing a title. constructing a title.
- #648080 pvhee: FeedsNodeProcessor - static caching of mapping targets makes - #648080 pvhee: FeedsNodeProcessor - static caching of mapping targets makes
......
...@@ -346,6 +346,28 @@ class FeedsDateTimeElement extends FeedsElement { ...@@ -346,6 +346,28 @@ class FeedsDateTimeElement extends FeedsElement {
class FeedsDateTime extends DateTime { class FeedsDateTime extends DateTime {
public $granularity = array(); public $granularity = array();
protected static $allgranularity = array('year', 'month', 'day', 'hour', 'minute', 'second', 'zone'); protected static $allgranularity = array('year', 'month', 'day', 'hour', 'minute', 'second', 'zone');
private $_serialized_time;
private $_serialized_timezone;
/**
* Helper function to prepare the object during serialization.
*
* We are extending a core class and core classes cannot be serialized.
*
* Ref: http://bugs.php.net/41334, http://bugs.php.net/39821
*/
public function __sleep(){
$this->_serialized_time = $this->format('c');
$this->_serialized_timezone = $this->getTimezone()->getName();
return array('_serialized_time', '_serialized_timezone');
}
/**
* Upon unserializing, we must re-build ourselves using local variables.
*/
public function __wakeup() {
$this->__construct($this->_serialized_time, new DateTimeZone($this->_serialized_timezone));
}
/** /**
* Overridden constructor. * Overridden constructor.
......
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