Fix errors

This commit is contained in:
Art4 2024-12-07 22:08:59 +00:00
parent 43c71412e4
commit 82ed43f507
3 changed files with 9 additions and 10 deletions

View file

@ -29,10 +29,10 @@ function getWeather($loc, $units = 'metric', $lang = 'en', $appid = '', $cacheti
$now = new DateTime();
if (!is_null($cached)) {
$cdate = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'curweather', 'last');
$cdate = (int) DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'curweather', 'last');
$cached = unserialize($cached);
if ($cdate + $cachetime > $now->getTimestamp()) {
if ($cdate + (int) $cachetime > $now->getTimestamp()) {
return $cached;
}
}