Changeset 52469
- Timestamp:
- 01/06/2022 06:09:54 PM (3 years ago)
- Location:
- branches/5.4
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.4
- Property svn:mergeinfo changed
/trunk merged: 52454-52457
- Property svn:mergeinfo changed
-
branches/5.4/src/wp-admin/includes/upgrade.php
r47280 r52469 1615 1615 while ( $rows = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options ORDER BY option_id LIMIT $start, 20" ) ) { 1616 1616 foreach ( $rows as $row ) { 1617 $value = $row->option_value;1618 if ( ! @unserialize( $value )) {1617 $value = maybe_unserialize( $row->option_value ); 1618 if ( $value === $row->option_value ) { 1619 1619 $value = stripslashes( $value ); 1620 1620 } -
branches/5.4/src/wp-includes/class-wp-meta-query.php
r47060 r52469 813 813 $sibling_compare = strtoupper( $sibling['compare'] ); 814 814 if ( in_array( $clause_compare, $compatible_compares ) && in_array( $sibling_compare, $compatible_compares ) ) { 815 $alias = $sibling['alias'];815 $alias = preg_replace( '/\W/', '_', $sibling['alias'] ); 816 816 break; 817 817 } -
branches/5.4/src/wp-includes/class-wp-tax-query.php
r47122 r52469 528 528 // The sibling must both have compatible operator to share its alias. 529 529 if ( in_array( strtoupper( $sibling['operator'] ), $compatible_operators ) ) { 530 $alias = $sibling['alias'];530 $alias = preg_replace( '/\W/', '_', $sibling['alias'] ); 531 531 break; 532 532 } … … 557 557 } 558 558 559 $query['terms'] = array_unique( (array) $query['terms'] ); 559 if ( 'slug' === $query['field'] || 'name' === $query['field'] ) { 560 $query['terms'] = array_unique( (array) $query['terms'] ); 561 } else { 562 $query['terms'] = wp_parse_id_list( $query['terms'] ); 563 } 560 564 561 565 if ( is_taxonomy_hierarchical( $query['taxonomy'] ) && $query['include_children'] ) { -
branches/5.4/src/wp-includes/formatting.php
r47643 r52469 1158 1158 * 1159 1159 * @since 1.5.0 1160 * 1161 * @param string $utf8_string 1162 * @param int $length Max length of the string 1160 * @since 5.8.3 Added the `encode_ascii_characters` parameter. 1161 * 1162 * @param string $utf8_string String to encode. 1163 * @param int $length Max length of the string 1164 * @param bool $encode_ascii_characters Whether to encode ascii characters such as < " ' 1163 1165 * @return string String with Unicode encoded for URI. 1164 1166 */ 1165 function utf8_uri_encode( $utf8_string, $length = 0 ) {1167 function utf8_uri_encode( $utf8_string, $length = 0, $encode_ascii_characters = false ) { 1166 1168 $unicode = ''; 1167 1169 $values = array(); … … 1178 1180 1179 1181 if ( $value < 128 ) { 1180 if ( $length && ( $unicode_length >= $length ) ) { 1182 $char = chr( $value ); 1183 $encoded_char = $encode_ascii_characters ? rawurlencode( $char ) : $char; 1184 $encoded_char_length = strlen( $encoded_char ); 1185 if ( $length && ( $unicode_length + $encoded_char_length ) > $length ) { 1181 1186 break; 1182 1187 } 1183 $unicode .= chr( $value );1184 $unicode_length ++;1188 $unicode .= $encoded_char; 1189 $unicode_length += $encoded_char_length; 1185 1190 } else { 1186 1191 if ( count( $values ) == 0 ) { -
branches/5.4/src/wp-includes/post.php
r47639 r52469 4510 4510 $slug = substr( $slug, 0, $length ); 4511 4511 } else { 4512 $slug = utf8_uri_encode( $decoded_slug, $length );4512 $slug = utf8_uri_encode( $decoded_slug, $length, true ); 4513 4513 } 4514 4514 }
Note: See TracChangeset
for help on using the changeset viewer.