Silence deprecation errors for strtime in PHP8.1 or higher

Fixes #672 (#811)
This commit is contained in:
Simon Wisselink
2022-09-22 14:11:36 +02:00
committed by GitHub
parent f8a958cd53
commit c53342c9fc
3 changed files with 7 additions and 5 deletions

View File

@@ -78,7 +78,8 @@ function smarty_modifier_date_format($string, $format = null, $default_date = ''
}
$format = str_replace($_win_from, $_win_to, $format);
}
return strftime($format, $timestamp);
// @ to suppress deprecation errors when running in PHP8.1 or higher.
return @strftime($format, $timestamp);
} else {
return date($format, $timestamp);
}