Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: strict comparison in options-general.php
  • Loading branch information
snehapatil2001 committed Jul 3, 2024
commit 5d5b7aa652b1b8770cd9acbba6f3b46bd07701d2
8 changes: 5 additions & 3 deletions src/wp-admin/options-general.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,14 @@ class="<?php echo esc_attr( $classes_for_button ); ?>"

if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists.
$check_zone_info = false;
if ( 0 === (int) $current_offset ) {
if ( 0 === $current_offset || '0' === $current_offset ) {
$tzstring = 'UTC+0';
} elseif ( $current_offset < 0 ) {
} elseif ( ( is_numeric( $current_offset ) && (float) $current_offset < 0 ) ) {
$tzstring = 'UTC' . $current_offset;
} else {
} elseif ( is_numeric( $current_offset ) ) {
$tzstring = 'UTC+' . $current_offset;
} else {
$tzstring = 'UTC+0';
}
}

Expand Down