Make WordPress Core

Ticket #58102: 58102.diff

File 58102.diff, 627 bytes (added by viralsampat, 4 years ago)

I have checked above mentioned issue and I have resolved it and added patch.

  • src/wp-includes/option.php

    diff --git a/src/wp-includes/option.php b/src/wp-includes/option.php
    index 9952514733..ea9ff56d4e 100644
    a b function wp_user_settings() {  
    11151115        $settings = (string) get_user_option( 'user-settings', $user_id );
    11161116
    11171117        if ( isset( $_COOKIE[ 'wp-settings-' . $user_id ] ) ) {
    1118                 $cookie = preg_replace( '/[^A-Za-z0-9=&_]/', '', $_COOKIE[ 'wp-settings-' . $user_id ] );
     1118                $cookie = preg_replace( '/[^A-Za-z0-9=&_]/', '', sanitize_text_field( $_COOKIE[ 'wp-settings-' . $user_id ] ) );
    11191119
    11201120                // No change or both empty.
    11211121                if ( $cookie == $settings ) {