summaryrefslogtreecommitdiff
path: root/modules/aggregator.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-12-15 16:02:50 +0000
committerDries Buytaert <dries@buytaert.net>2005-12-15 16:02:50 +0000
commit5accfa08f52a31da74715c38a1d7a12793fa33c7 (patch)
treec4608737b446716a418a40f0ed21722195fedebd /modules/aggregator.module
parent264f7d5667e83cf07c38b91cfd170e57f845a5f2 (diff)
downloadbrdo-5accfa08f52a31da74715c38a1d7a12793fa33c7.tar.gz
brdo-5accfa08f52a31da74715c38a1d7a12793fa33c7.tar.bz2
- Patch #41133 by DriesK: as of PHP 5.1.0, strtotime() returns FALSE on failure instead of -1.
Changed code to be compatible with all versions.
Diffstat (limited to 'modules/aggregator.module')
-rw-r--r--modules/aggregator.module10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/aggregator.module b/modules/aggregator.module
index 8ac5ca705..8c1007ae6 100644
--- a/modules/aggregator.module
+++ b/modules/aggregator.module
@@ -484,7 +484,7 @@ function aggregator_parse_w3cdtf($date_str) {
return $epoch;
}
else {
- return -1;
+ return FALSE;
}
}
@@ -580,10 +580,10 @@ function aggregator_parse_feed(&$data, $feed) {
else if ($item['MODIFIED']) $date = $item['MODIFIED']; // Atom XML
else $date = 'now';
- $timestamp = strtotime($date); // strtotime() returns -1 on failure
- if ($timestamp < 0) {
- $timestamp = aggregator_parse_w3cdtf($date); // also returns -1 on failure
- if ($timestamp < 0) {
+ $timestamp = strtotime($date); // As of PHP 5.1.0, strtotime returns FALSE on failure instead of -1.
+ if ($timestamp <= 0) {
+ $timestamp = aggregator_parse_w3cdtf($date); // Returns FALSE on failure
+ if (!$timestamp) {
$timestamp = time(); // better than nothing
}
}