mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-20 01:19:21 +01:00
Silence deprecation errors for strtime in PHP8.1 or higher
Fixes #672 (#811)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user