Changeset 63113
- Timestamp:
- 08/06/2026 07:56:28 PM (5 weeks ago)
- Location:
- branches/4.9/src
- Files:
-
- 7 edited
-
wp-admin/includes/user.php (modified) (3 diffs)
-
wp-admin/js/inline-edit-post.js (modified) (1 diff)
-
wp-includes/canonical.php (modified) (1 diff)
-
wp-includes/http.php (modified) (1 diff)
-
wp-includes/kses.php (modified) (1 diff)
-
wp-includes/user.php (modified) (7 diffs)
-
wp-signup.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.9/src/wp-admin/includes/user.php
r43487 r63113 43 43 $user->user_login = sanitize_user($_POST['user_login'], true); 44 44 45 $errors = new WP_Error(); 46 45 47 $pass1 = $pass2 = ''; 46 48 if ( isset( $_POST['pass1'] ) ) … … 63 65 } 64 66 65 if ( isset( $_POST['email'] )) 66 $user->user_email = sanitize_text_field( wp_unslash( $_POST['email'] ) ); 67 if ( isset( $_POST['email'] ) ) { 68 $maybe_email = wp_unslash( $_POST['email'] ); 69 if ( is_string( $maybe_email ) && is_email( $maybe_email ) ) { 70 $user->user_email = $maybe_email; 71 } else { 72 $errors->add( 'invalid_email', __( '<strong>ERROR</strong>: The email address isn’t correct.' ), array( 'form-field' => 'email' ) ); 73 } 74 } 67 75 if ( isset( $_POST['url'] ) ) { 68 76 if ( empty ( $_POST['url'] ) || $_POST['url'] == 'http://' ) { … … 117 125 if ( !empty($_POST['use_ssl']) ) 118 126 $user->use_ssl = 1; 119 120 $errors = new WP_Error();121 127 122 128 /* checking that username has been typed */ -
branches/4.9/src/wp-admin/js/inline-edit-post.js
r41684 r63113 275 275 276 276 // The post author no longer has edit capabilities, so we need to add them to the list of authors. 277 $(':input[name="post_author"]', editRow).prepend('<option value="' + $('.post_author', rowData).text() + '">' + $('#' + t.type + '-' + id + ' .author').text() + '</option>'); 277 $(':input[name="post_author"]', editRow).prepend( 278 new Option( 279 $('#' + t.type + '-' + id + ' .author').text(), 280 $('.post_author', rowData).text() 281 ) 282 ); 278 283 } 279 284 if ( $( ':input[name="post_author"] option', editRow ).length === 1 ) { -
branches/4.9/src/wp-includes/canonical.php
r41991 r63113 611 611 612 612 if ( get_query_var('name') ) { 613 $publicly_viewable_post_types = array_filter( get_post_types( array( 'exclude_from_search' => false ) ), 'is_post_type_viewable' ); 614 613 615 $where = $wpdb->prepare("post_name LIKE %s", $wpdb->esc_like( get_query_var('name') ) . '%'); 614 616 615 617 // if any of post_type, year, monthnum, or day are set, use them to refine the query 616 if ( get_query_var('post_type') ) 617 $where .= $wpdb->prepare(" AND post_type = %s", get_query_var('post_type')); 618 else 619 $where .= " AND post_type IN ('" . implode( "', '", get_post_types( array( 'public' => true ) ) ) . "')"; 618 if ( get_query_var( 'post_type' ) ) { 619 if ( is_array( get_query_var( 'post_type' ) ) ) { 620 $post_types = array_intersect( get_query_var( 'post_type' ), $publicly_viewable_post_types ); 621 if ( empty( $post_types ) ) { 622 return false; 623 } 624 $where .= " AND post_type IN ('" . implode( "', '", esc_sql( $post_types ) ) . "')"; 625 } else { 626 if ( ! in_array( get_query_var( 'post_type' ), $publicly_viewable_post_types, true ) ) { 627 return false; 628 } 629 $where .= $wpdb->prepare( ' AND post_type = %s', get_query_var( 'post_type' ) ); 630 } 631 } else { 632 $where .= " AND post_type IN ('" . implode( "', '", esc_sql( $publicly_viewable_post_types ) ) . "')"; 633 } 620 634 621 635 if ( get_query_var('year') ) -
branches/4.9/src/wp-includes/http.php
r46493 r63113 548 548 if ( $ip ) { 549 549 $parts = array_map( 'intval', explode( '.', $ip ) ); 550 if ( 127 === $parts[0] || 10 === $parts[0] || 0 === $parts[0] 551 || ( 172 === $parts[0] && 16 <= $parts[1] && 31 >= $parts[1] ) 552 || ( 192 === $parts[0] && 168 === $parts[1] ) 550 551 /* 552 * These IP address ranges are not considered valid external hosts for HTTP requests. 553 * 554 * If the host resolves to an IP address in these ranges, the request will be rejected unless the 'http_request_host_is_external' filter allows it. 555 * 556 * References: 557 * 558 * - IPv4 Special-Purpose Address Space: https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml 559 * - IPv4 Multicast Address Assignments: https://www.rfc-editor.org/rfc/rfc5771.html 560 */ 561 if ( 127 === $parts[0] || 10 === $parts[0] || 0 === $parts[0] // 127.0.0.0/8 (loopback), 10.0.0.0/8 (private), 0.0.0.0/8 (this network). 562 || ( 172 === $parts[0] && 16 <= $parts[1] && 31 >= $parts[1] ) // 172.16.0.0/12 (private). 563 || ( 192 === $parts[0] && 168 === $parts[1] ) // 192.168.0.0/16 (private). 564 || ( 192 === $parts[0] && 0 === $parts[1] && 0 === $parts[2] ) // 192.0.0.0/24 (IETF protocol assignments). 565 || ( 192 === $parts[0] && 0 === $parts[1] && 2 === $parts[2] ) // 192.0.2.0/24 (TEST-NET-1). 566 || ( 192 === $parts[0] && 88 === $parts[1] && 99 === $parts[2] ) // 192.88.99.0/24 (6to4 relay anycast). 567 || ( 198 === $parts[0] && 51 === $parts[1] && 100 === $parts[2] ) // 198.51.100.0/24 (TEST-NET-2). 568 || ( 203 === $parts[0] && 0 === $parts[1] && 113 === $parts[2] ) // 203.0.113.0/24 (TEST-NET-3). 569 || ( 169 === $parts[0] && 254 === $parts[1] ) // 169.254.0.0/16 (link-local and cloud metadata). 570 || ( 100 === $parts[0] && 64 <= $parts[1] && 127 >= $parts[1] ) // 100.64.0.0/10 (CGNAT). 571 || ( 198 === $parts[0] && 18 <= $parts[1] && 19 >= $parts[1] ) // 198.18.0.0/15 (benchmarking). 572 || ( 224 <= $parts[0] && 239 >= $parts[0] ) // 224.0.0.0/4 (multicast). 573 || 240 <= $parts[0] // 240.0.0.0/4 (reserved, includes 255.255.255.255 broadcast). 553 574 ) { 554 575 // If host appears local, reject unless specifically allowed. -
branches/4.9/src/wp-includes/kses.php
r62004 r63113 1756 1756 $css = str_replace(array("\n","\r","\t"), '', $css); 1757 1757 1758 if ( preg_match( '%[\\\\(&=}]|/\*%', $css ) ) // remove any inline css containing \ ( & } = or comments1758 if ( 0 !== preg_match( '%[\\\\(&=}]|/\*%', $css ) ) // remove any inline css containing \ ( & } = or comments 1759 1759 return ''; 1760 1760 -
branches/4.9/src/wp-includes/user.php
r47648 r63113 170 170 /* translators: %s: user name */ 171 171 __( '<strong>ERROR</strong>: The password you entered for the username %s is incorrect.' ), 172 '<strong>' . $username. '</strong>'172 '<strong>' . esc_html( $username ) . '</strong>' 173 173 ) . 174 174 ' <a href="' . wp_lostpassword_url() . '">' . … … 242 242 /* translators: %s: email address */ 243 243 __( '<strong>ERROR</strong>: The password you entered for the email address %s is incorrect.' ), 244 '<strong>' . $email. '</strong>'244 '<strong>' . esc_html( $email ) . '</strong>' 245 245 ) . 246 246 ' <a href="' . wp_lostpassword_url() . '">' . … … 2409 2409 $user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email ); 2410 2410 if ( ! $user_id || is_wp_error( $user_id ) ) { 2411 $errors->add( 'registerfail', sprintf( __( '<strong>ERROR</strong>: Couldn’t register you… please contact the <a href="mailto:%s">webmaster</a> !' ), get_option( 'admin_email') ) );2411 $errors->add( 'registerfail', sprintf( __( '<strong>ERROR</strong>: Couldn’t register you… please contact the <a href="mailto:%s">webmaster</a> !' ), esc_attr( get_option( 'admin_email' ) ) ) ); 2412 2412 return $errors; 2413 2413 } … … 2617 2617 * @since 3.0.0 2618 2618 * @since 4.9.0 This function was moved from wp-admin/includes/ms.php so it's no longer Multisite specific. 2619 * @since 7.0.3 Added the `$user_id` parameter, which is sent with the `personal_options_update` action. 2620 * 2621 * @param int $user_id Optional. The ID of the user whose email is being changed. Defaults to `$_POST['user_id']` if set, otherwise 0. 2619 2622 * 2620 2623 * @global WP_Error $errors WP_Error object. 2621 2624 * @global wpdb $wpdb WordPress database object. 2622 2625 */ 2623 function send_confirmation_on_profile_email( ) {2626 function send_confirmation_on_profile_email( $user_id = 0 ) { 2624 2627 global $errors, $wpdb; 2628 2629 // Maintain backward compatibility for those relying on a check based on $_POST['user_id']. 2630 if ( ! $user_id && isset( $_POST['user_id'] ) ) { 2631 $user_id = (int) $_POST['user_id']; 2632 } 2625 2633 2626 2634 $current_user = wp_get_current_user(); … … 2629 2637 } 2630 2638 2631 if ( $current_user->ID != $_POST['user_id']) {2639 if ( 0 === $current_user->ID || $current_user->ID !== (int) $user_id ) { 2632 2640 return false; 2633 2641 } … … 2639 2647 ) ); 2640 2648 2649 $_POST['email'] = addslashes( $current_user->user_email ); 2641 2650 return; 2642 2651 } … … 2648 2657 delete_user_meta( $current_user->ID, '_new_email' ); 2649 2658 2659 $_POST['email'] = addslashes( $current_user->user_email ); 2650 2660 return; 2651 2661 } -
branches/4.9/src/wp-signup.php
r43031 r63113 874 874 break; 875 875 case 'gimmeanotherblog': 876 validate_another_blog_signup(); 876 if ( 'all' === $active_signup || 'blog' === $active_signup ) { 877 validate_another_blog_signup(); 878 } else { 879 _e( 'Site registration has been disabled.' ); 880 } 877 881 break; 878 882 case 'default':
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)