Changeset 52294
- Timestamp:
- 11/30/2021 09:00:32 PM (19 months ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r52292 r52294 4712 4712 4713 4713 $original_value = $value; 4714 $error = '';4714 $error = null; 4715 4715 4716 4716 switch ( $option ) { … … 4920 4920 } 4921 4921 4922 if ( 'permalink_structure' === $option && '' !== $value && ! preg_match( '/%[^\/%]+%/', $value ) ) { 4922 if ( 'permalink_structure' === $option && null === $error 4923 && '' !== $value && ! preg_match( '/%[^\/%]+%/', $value ) 4924 ) { 4923 4925 $error = sprintf( 4924 4926 /* translators: %s: Documentation URL. */ … … 4949 4951 } 4950 4952 4951 if ( ! empty( $error ) ) { 4953 if ( null !== $error ) { 4954 if ( '' === $error && is_wp_error( $value ) ) { 4955 /* translators: 1: Option name, 2: Error code. */ 4956 $error = sprintf( __( 'Could not sanitize the %1$s option. Error code: %2$s' ), $option, $value->get_error_code() ); 4957 } 4958 4952 4959 $value = get_option( $option ); 4953 4960 if ( function_exists( 'add_settings_error' ) ) { -
trunk/src/wp-includes/wp-db.php
r52218 r52294 2886 2886 $results = $this->get_results( "SHOW FULL COLUMNS FROM $table" ); 2887 2887 if ( ! $results ) { 2888 return new WP_Error( 'wpdb_get_table_charset_failure' );2888 return new WP_Error( 'wpdb_get_table_charset_failure', __( 'Could not retrieve table charset.' ) ); 2889 2889 } 2890 2890 … … 3328 3328 $row = $this->get_row( 'SELECT ' . implode( ', ', $sql ), ARRAY_A ); 3329 3329 if ( ! $row ) { 3330 return new WP_Error( 'wpdb_strip_invalid_text_failure' );3330 return new WP_Error( 'wpdb_strip_invalid_text_failure', __( 'Could not strip invalid text.' ) ); 3331 3331 } 3332 3332 -
trunk/tests/phpunit/tests/option/sanitize-option.php
r48937 r52294 156 156 array( '/%year%/%monthnum%/%day%/%postname%/', '/%year%/%monthnum%/%day%/%postname%/', true ), 157 157 array( '/%year/%postname%/', '/%year/%postname%/', true ), 158 array( new WP_Error( 'wpdb_get_table_charset_failure' ), false, false ), // ticket 53986 158 159 ); 159 160 }
Note: See TracChangeset
for help on using the changeset viewer.