From c24408f6eda8347bba17c83e027f118091986488 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 18 Mar 2011 02:51:43 +0100 Subject: [PATCH] [ticket/10021] Add comment explaining why we can check -1 as an error value. PHPBB3-10021 --- phpBB/memberlist.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index b1b9e87422..599cd0b3e7 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -1072,6 +1072,11 @@ switch ($mode) if (isset($find_key_match[$joined_select]) && sizeof($joined) == 3) { + // Before PHP 5.1 an error value -1 can be returned instead of false. + // Theoretically gmmktime() can also legitimately return -1 as an actual timestamp. + // But since we do not pass the $second parameter to gmmktime(), + // an actual unix timestamp -1 cannot be returned in this case. + // Thus we can check whether it is -1 and treat -1 as an error. $joined_time = gmmktime(0, 0, 0, (int) $joined[1], (int) $joined[2], (int) $joined[0]); if ($joined_time !== false && $joined_time !== -1)