summaryrefslogtreecommitdiff
path: root/modules/node
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/node
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/node')
-rw-r--r--modules/node/node.module4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/node/node.module b/modules/node/node.module
index 4da1629f0..37317c522 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1544,8 +1544,8 @@ function node_validate($node) {
form_set_error('name', t('The username %name does not exist.', array ('%name' => theme('placeholder', $node->name))));
}
- // Validate the "authored on" field.
- if (strtotime($node->date) == -1) {
+ // Validate the "authored on" field. As of PHP 5.1.O, strtotime returns FALSE instead of -1 upon failure.
+ if (strtotime($node->date) <= 0) {
form_set_error('date', t('You have to specify a valid date.'));
}
}