mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/10021] Add comment explaining why we can check -1 as an error value.
PHPBB3-10021
This commit is contained in:
parent
65580f7901
commit
c24408f6ed
1 changed files with 5 additions and 0 deletions
|
@ -1072,6 +1072,11 @@ switch ($mode)
|
||||||
|
|
||||||
if (isset($find_key_match[$joined_select]) && sizeof($joined) == 3)
|
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]);
|
$joined_time = gmmktime(0, 0, 0, (int) $joined[1], (int) $joined[2], (int) $joined[0]);
|
||||||
|
|
||||||
if ($joined_time !== false && $joined_time !== -1)
|
if ($joined_time !== false && $joined_time !== -1)
|
||||||
|
|
Loading…
Add table
Reference in a new issue