Make WordPress Core

Changeset 56949

Timestamp:
10/16/2023 11:49:10 PM (10 months ago)
Author:
peterwilsoncc
Message:

Options, Meta APIs: Prevent saving of invalid timezones.

Prevent the saving of invalid timezone string in to the database on the options pages. If an invalid timezone is submitted it is ignored and the setting remains unchanged.

This prevents a warning or fatal (depending on the PHP version) from being thrown by an invalid timezone setting on the Settings > General page.

Props ankit-k-gupta, costdev, huzaifaalmesbah, mrinal013, nicolefurlan, oglekler.
Fixes #58814.

Location:
trunk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/options.php

    r56570 r56949  
    280280            $_POST['gmt_offset']      = preg_replace( '/UTC\+?/', '', $_POST['gmt_offset'] );
    281281            $_POST['timezone_string'] = '';
     282
     283
     284
     285
     286
     287
     288
     289
     290
     291
     292
     293
     294
     295
     296
     297
     298
    282299        }
    283300
Note: See TracChangeset for help on using the changeset viewer.