Changeset 54554
- Timestamp:
- 10/17/2022 05:55:03 PM (2 years ago)
- Location:
- branches/4.2
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.2
- Property svn:mergeinfo changed
/trunk merged: 54521-54523,54525,54527,54529-54530,54541
- Property svn:mergeinfo changed
-
branches/4.2/src/wp-includes/comment.php
r32367 r54554 2427 2427 } 2428 2428 2429 $filter_comment = false; 2430 if ( ! has_filter( 'pre_comment_content', 'wp_filter_kses' ) ) { 2431 $filter_comment = ! user_can( isset( $comment['user_id'] ) ? $comment['user_id'] : 0, 'unfiltered_html' ); 2432 } 2433 2434 if ( $filter_comment ) { 2435 add_filter( 'pre_comment_content', 'wp_filter_kses' ); 2436 } 2437 2429 2438 // Escape data pulled from DB. 2430 2439 $comment = wp_slash($comment); … … 2436 2445 2437 2446 $commentarr = wp_filter_comment( $commentarr ); 2447 2448 if ( $filter_comment ) { 2449 remove_filter( 'pre_comment_content', 'wp_filter_kses' ); 2450 } 2438 2451 2439 2452 // Now extract the merged array. -
branches/4.2/src/wp-includes/date.php
r32116 r54554 153 153 public function __construct( $date_query, $default_column = 'post_date' ) { 154 154 155 if ( isset( $date_query['relation'] ) && 'OR' === strtoupper( $date_query['relation'] )) {156 $this->relation = 'OR';155 if ( isset( $date_query['relation'] ) ) { 156 $this->relation = $this->sanitize_relation( $date_query['relation'] ); 157 157 } else { 158 158 $this->relation = 'AND'; … … 233 233 $this->validate_date_values( $queries ); 234 234 } 235 236 // Sanitize the relation parameter. 237 $queries['relation'] = $this->sanitize_relation( $queries['relation'] ); 235 238 236 239 foreach ( $queries as $key => $q ) { … … 1011 1014 return $wpdb->prepare( "DATE_FORMAT( $column, %s ) $compare %f", $format, $time ); 1012 1015 } 1016 1017 /** 1018 * Sanitizes a 'relation' operator. 1019 * 1020 * @since 6.0.3 1021 * 1022 * @param string $relation Raw relation key from the query argument. 1023 * @return string Sanitized relation ('AND' or 'OR'). 1024 */ 1025 public function sanitize_relation( $relation ) { 1026 if ( 'OR' === strtoupper( $relation ) ) { 1027 return 'OR'; 1028 } else { 1029 return 'AND'; 1030 } 1031 } 1013 1032 } -
branches/4.2/src/wp-includes/default-widgets.php
r33529 r54554 1055 1055 if ( is_wp_error($rss) ) { 1056 1056 if ( is_admin() || current_user_can('manage_options') ) 1057 echo '<p>' . sprintf( __('<strong>RSS Error</strong>: %s'), $rss->get_error_message() ) . '</p>';1057 echo '<p>' . sprintf( __('<strong>RSS Error</strong>: %s'), esc_html( $rss->get_error_message() ) ) . '</p>'; 1058 1058 return; 1059 1059 } … … 1165 1165 1166 1166 if ( ! empty( $args['error'] ) ) { 1167 echo '<p class="widget-error"><strong>' . sprintf( __( 'RSS Error: %s' ), $args['error']) . '</strong></p>';1167 echo '<p class="widget-error"><strong>' . sprintf( __( 'RSS Error: %s' ), esc_html( $args['error'] ) ) . '</strong></p>'; 1168 1168 } 1169 1169 -
branches/4.2/src/wp-includes/functions.php
r46500 r54554 2441 2441 } else { 2442 2442 $html = __( 'Are you sure you want to do this?' ); 2443 if ( wp_get_referer() ) 2444 $html .= "</p><p><a href='" . esc_url( remove_query_arg( 'updated', wp_get_referer() ) ) . "'>" . __( 'Please try again.' ) . "</a>"; 2443 if ( wp_get_referer() ) { 2444 $wp_http_referer = remove_query_arg( 'updated', wp_get_referer() ); 2445 $wp_http_referer = wp_validate_redirect( esc_url_raw( $wp_http_referer ) ); 2446 $html .= '</p><p>'; 2447 $html .= sprintf( 2448 '<a href="%s">%s</a>', 2449 esc_url( $wp_http_referer ), 2450 __( 'Please try again.' ) 2451 ); 2452 } 2445 2453 } 2446 2454 -
branches/4.2/src/wp-includes/pluggable.php
r47970 r54554 357 357 $phpmailer->ClearCustomHeaders(); 358 358 $phpmailer->ClearReplyTos(); 359 $phpmailer->Body = ''; 360 $phpmailer->AltBody = ''; 359 361 360 362 // From email and name -
branches/4.2/src/wp-mail.php
r39778 r54554 60 60 wp_die( __('There doesn’t seem to be any new mail.') ); 61 61 } 62 63 // Always run as an unauthenticated user. 64 wp_set_current_user( 0 ); 62 65 63 66 for ( $i = 1; $i <= $count; $i++ ) { … … 126 129 $author = sanitize_email($author); 127 130 if ( is_email($author) ) { 128 echo '<p>' . sprintf(__('Author is %s'), $author) . '</p>';129 131 $userdata = get_user_by('email', $author); 130 132 if ( ! empty( $userdata ) ) { -
branches/4.2/src/wp-trackback.php
r30662 r54554 13 13 wp( array( 'tb' => '1' ) ); 14 14 } 15 16 // Always run as an unauthenticated user. 17 wp_set_current_user( 0 ); 15 18 16 19 /**
Note: See TracChangeset
for help on using the changeset viewer.