Changeset 56132
- Timestamp:
- 07/04/2023 01:40:55 PM (15 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r56031 r56132 4884 4884 4885 4885 case 'blog_charset': 4886 $value = preg_replace( '/[^a-zA-Z0-9_-]/', '', $value ); // Strips slashes. 4886 if ( is_string( $value ) ) { 4887 $value = preg_replace( '/[^a-zA-Z0-9_-]/', '', $value ); // Strips slashes. 4888 } else { 4889 $value = ''; 4890 } 4887 4891 break; 4888 4892 … … 4919 4923 4920 4924 case 'gmt_offset': 4921 $value = preg_replace( '/[^0-9:.-]/', '', $value ); // Strips slashes. 4925 if ( is_numeric( $value ) ) { 4926 $value = preg_replace( '/[^0-9:.-]/', '', $value ); // Strips slashes. 4927 } else { 4928 $value = ''; 4929 } 4922 4930 break; 4923 4931 -
trunk/tests/phpunit/tests/option/sanitizeOption.php
r55562 r56132 37 37 array( 'blog_charset', 'UTF-8', 'UTF-8' ), 38 38 array( 'blog_charset', 'charset', '">charset<"' ), 39 array( 'blog_charset', '', null ), 39 40 array( 'blog_public', 1, null ), 40 41 array( 'blog_public', 1, '1' ), … … 46 47 array( 'gmt_offset', '0', 0 ), 47 48 array( 'gmt_offset', '1.5', '1.5' ), 49 array( 'gmt_offset', '', null ), 48 50 array( 'siteurl', 'http://example.org', 'http://example.org' ), 49 51 array( 'siteurl', 'http://example.org/subdir', 'http://example.org/subdir' ),
Note: See TracChangeset
for help on using the changeset viewer.