1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-30 04:58:37 +01:00

[ticket/14536] Force unix time stamps to be integer

This will ensure to prevent PHP fatal errors in case the passed timestamp
is an empty string or does not evaluate to an integer (i.e. strings like
foobar).

PHPBB3-14536
This commit is contained in:
Marc Alexander 2016-03-14 13:33:37 +01:00
parent 48bdab88de
commit 10d4093561

View File

@ -725,7 +725,7 @@ class user extends \phpbb\session
$utc = new \DateTimeZone('UTC');
}
$time = new $this->datetime($this, "@$gmepoch", $utc);
$time = new $this->datetime($this, '@' . (int) $gmepoch, $utc);
$time->setTimezone($this->timezone);
return $time->format($format, $forcedate);