[wp-trac] [WordPress Trac] #58814: Intensionally inset general->timezone_string field wrong format makes error in 'Time Format' & 'Date Format'

WordPress Trac noreply at wordpress.org
Fri Sep 8 18:42:51 UTC 2023


#58814: Intensionally inset general->timezone_string field wrong format makes error
in 'Time Format' & 'Date Format'
-------------------------------------------------+-------------------------
 Reporter:  mrinal013                            |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  6.4
Component:  Options, Meta APIs                   |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-screenshots has-patch has-unit-  |     Focuses:
  tests needs-testing                            |
-------------------------------------------------+-------------------------

Comment (by Ankit K Gupta):

 == Test Report ❌


 Patch tested: https://github.com/WordPress/wordpress-develop/pull/4853


 **Testing Environment:**

 * WordPress - 6.4-alpha-20230908.205513
 * Web Server: Nginx
 * Chrome Version - 116
 * OS -  macOS
 * Theme: Twenty Twenty-Three
 * PHP - 7.4.0


 **Test result:**

 The patch functions correctly when an invalid timezone is entered, such as
 a number (0), special characters ($#%@), or alphabetic characters (e.g.,
 "Five:Thirty").
 However, when a valid timezone is manually inputted, it results in errors.
 This needs attention and rectification.

 **Steps to Reproduce:**

 1. Choose a timezone from the dropdown options, e.g., "UTC+0."
 2. Save the selected timezone setting.
 3. Inspect the element and select the value that was chosen, e.g.,
 {{{
 <option selected="selected" value="UTC+0">UTC+0</option>.
 }}}

 4. Modify the value to
 {{{
 <option selected="selected" value="0">0</option>.
 }}}

 5. Save the setting. Observe that an error message appears in the header
 as expected.
 6. Choose the selected value again and input a valid timezone format like
 'UTC+8:30' e.g.,
 {{{
 <option selected="selected" value="UTC+8:30">UTC+8:30</option>.
 }}}

 7. Save the setting again.
 8. Notice the PHP warnings displayed.


 **Issue Demonstration Video:**
 https://www.loom.com/share/9c4f5c7db3874bc08fa4629f64c99ca5


 **Screenshot:**

 **When using Valid Timezone:**
 [[Image(https://i.imgur.com/DR8mU7Z.jpg)]]


 **When adding Invalid TimeZone**

 [[Image(https://i.imgur.com/vFUmNUL.jpg)]]

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


More information about the wp-trac mailing list