From 5accfa08f52a31da74715c38a1d7a12793fa33c7 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 15 Dec 2005 16:02:50 +0000 Subject: - 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. --- modules/node/node.module | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/node/node.module') 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.')); } } -- cgit v1.2.3