Fixed coding standards

This commit is contained in:
Claudio Sanches 2019-12-06 12:51:10 -03:00
parent 78e382e4d6
commit 85635773e9
1 changed files with 2 additions and 1 deletions

View File

@ -737,7 +737,8 @@ function wc_timezone_string() {
// Last try, guess timezone string manually.
foreach ( timezone_abbreviations_list() as $abbr ) {
foreach ( $abbr as $city ) {
if ( (bool) date( 'I' ) === (bool) $city['dst'] && $city['timezone_id'] && intval( $city['offset'] ) === $utc_offset ) {
// WordPress restrict the use of date(), since it's affected by timezone settings, but in this case is just what we need to guess the correct timezone.
if ( (bool) date( 'I' ) === (bool) $city['dst'] && $city['timezone_id'] && intval( $city['offset'] ) === $utc_offset ) { // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
return $city['timezone_id'];
}
}