Skip to content
Snippets Groups Projects
Commit f288fbcc authored by Chris Leppanen's avatar Chris Leppanen
Browse files

Issue #630288 by kulfi: Added import date compatibility issues with Google Groups' feeds.

parent 9b2d9410
No related branches found
No related tags found
No related merge requests found
...@@ -497,12 +497,25 @@ function _parser_common_syndication_RSS20_parse($feed_XML) { ...@@ -497,12 +497,25 @@ function _parser_common_syndication_RSS20_parse($feed_XML) {
*/ */
function _parser_common_syndication_parse_date($date_str) { function _parser_common_syndication_parse_date($date_str) {
// PHP < 5.3 doesn't like the GMT- notation for parsing timezones. // PHP < 5.3 doesn't like the GMT- notation for parsing timezones.
$date_str = str_replace("GMT-", "-", $date_str); $date_str = str_replace('GMT-', '-', $date_str);
$date_str = str_replace("GMT+", "+", $date_str); $date_str = str_replace('GMT+', '+', $date_str);
$parsed_date = strtotime($date_str); $parsed_date = strtotime($date_str);
if ($parsed_date === FALSE || $parsed_date == -1) { if ($parsed_date === FALSE || $parsed_date == -1) {
$parsed_date = _parser_common_syndication_parse_w3cdtf($date_str); $parsed_date = _parser_common_syndication_parse_w3cdtf($date_str);
} }
if (($parsed_date === FALSE || $parsed_date == -1)) {
// PHP does not support the UT timezone. Fake it. The system that generated
// this, Google Groups, probably meant UTC.
$date_str = strtolower(trim($date_str));
$last_three = substr($date_str, strlen($date_str) - 3, 3);
if ($last_three == ' ut') {
$parsed_date = strtotime($date_str . 'c');
}
}
return $parsed_date === FALSE ? time() : $parsed_date; return $parsed_date === FALSE ? time() : $parsed_date;
} }
......
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