Changeset 52471
- Timestamp:
- 01/06/2022 06:11:57 PM (3 years ago)
- Location:
- branches/5.2
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.2
- Property svn:mergeinfo changed
/trunk merged: 52454-52457
- Property svn:mergeinfo changed
-
branches/5.2/src/wp-admin/includes/upgrade.php
r45030 r52471 1592 1592 while ( $rows = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options ORDER BY option_id LIMIT $start, 20" ) ) { 1593 1593 foreach ( $rows as $row ) { 1594 $value = $row->option_value;1595 if ( ! @unserialize( $value )) {1594 $value = maybe_unserialize( $row->option_value ); 1595 if ( $value === $row->option_value ) { 1596 1596 $value = stripslashes( $value ); 1597 1597 } -
branches/5.2/src/wp-includes/class-wp-meta-query.php
r44518 r52471 732 732 $sibling_compare = strtoupper( $sibling['compare'] ); 733 733 if ( in_array( $clause_compare, $compatible_compares ) && in_array( $sibling_compare, $compatible_compares ) ) { 734 $alias = $sibling['alias'];734 $alias = preg_replace( '/\W/', '_', $sibling['alias'] ); 735 735 break; 736 736 } -
branches/5.2/src/wp-includes/class-wp-tax-query.php
r43571 r52471 527 527 // The sibling must both have compatible operator to share its alias. 528 528 if ( in_array( strtoupper( $sibling['operator'] ), $compatible_operators ) ) { 529 $alias = $sibling['alias'];529 $alias = preg_replace( '/\W/', '_', $sibling['alias'] ); 530 530 break; 531 531 } … … 556 556 } 557 557 558 $query['terms'] = array_unique( (array) $query['terms'] ); 558 if ( 'slug' === $query['field'] || 'name' === $query['field'] ) { 559 $query['terms'] = array_unique( (array) $query['terms'] ); 560 } else { 561 $query['terms'] = wp_parse_id_list( $query['terms'] ); 562 } 559 563 560 564 if ( is_taxonomy_hierarchical( $query['taxonomy'] ) && $query['include_children'] ) { -
branches/5.2/src/wp-includes/formatting.php
r47645 r52471 1151 1151 * 1152 1152 * @since 1.5.0 1153 * 1154 * @param string $utf8_string 1155 * @param int $length Max length of the string 1153 * @since 5.8.3 Added the `encode_ascii_characters` parameter. 1154 * 1155 * @param string $utf8_string String to encode. 1156 * @param int $length Max length of the string 1157 * @param bool $encode_ascii_characters Whether to encode ascii characters such as < " ' 1156 1158 * @return string String with Unicode encoded for URI. 1157 1159 */ 1158 function utf8_uri_encode( $utf8_string, $length = 0 ) {1160 function utf8_uri_encode( $utf8_string, $length = 0, $encode_ascii_characters = false ) { 1159 1161 $unicode = ''; 1160 1162 $values = array(); … … 1171 1173 1172 1174 if ( $value < 128 ) { 1173 if ( $length && ( $unicode_length >= $length ) ) { 1175 $char = chr( $value ); 1176 $encoded_char = $encode_ascii_characters ? rawurlencode( $char ) : $char; 1177 $encoded_char_length = strlen( $encoded_char ); 1178 if ( $length && ( $unicode_length + $encoded_char_length ) > $length ) { 1174 1179 break; 1175 1180 } 1176 $unicode .= chr( $value );1177 $unicode_length ++;1181 $unicode .= $encoded_char; 1182 $unicode_length += $encoded_char_length; 1178 1183 } else { 1179 1184 if ( count( $values ) == 0 ) { -
branches/5.2/src/wp-includes/post.php
r47645 r52471 4298 4298 $slug = substr( $slug, 0, $length ); 4299 4299 } else { 4300 $slug = utf8_uri_encode( $decoded_slug, $length );4300 $slug = utf8_uri_encode( $decoded_slug, $length, true ); 4301 4301 } 4302 4302 }
Note: See TracChangeset
for help on using the changeset viewer.