[wp-trac] [WordPress Trac] #57030: Condition is not strictly checked on options-general.php file

WordPress Trac noreply at wordpress.org
Wed Jul 3 23:21:23 UTC 2024


#57030: Condition is not strictly checked on options-general.php file
-------------------------------------------------+-------------------------
 Reporter:  rakibwordpress                       |       Owner:
                                                 |  SergeyBiryukov
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Administration                       |     Version:  3.0
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch changes-requested has-     |     Focuses:  coding-
  unit-tests close                               |  standards
-------------------------------------------------+-------------------------
Changes (by rajinsharwar):

 * keywords:  has-patch changes-requested has-unit-tests => has-patch
     changes-requested has-unit-tests close


Comment:

 I guess this was solved via #60700 as the strict checks have already been
 implemented. Maybe we can close this.

 Replying to [comment:4 SergeyBiryukov]:

 > This gets even more interesting, as the value can also be `float` or
 `false`, via `wp_timezone_override_offset()` hooked to
 `pre_option_gmt_offset` in `wp-includes/default-filters.php`.

 I guess when the value is false, it currently works fine with the logic of
 `$tzstring = 'UTC+' . $current_offset`. And, I do not think the value will
 ever be float, given that the code is wrapped with the check of `empty(
 $tzstring )`.

 In `wp_timezone_override_offset()` it states that it "**Overrides the
 gmt_offset option if we have a timezone_string available**". So, if the
 timezone is not available, I do not think a float will be returned.

 Marking this as a candidate for close.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57030#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list