Make WordPress Core


Ignore:
Timestamp:
02/23/2016 01:01:43 AM (10 years ago)
Author:
westonruter
Message:

Customize: Prevent dropping backslashes from input on general settings and settings for nav menus and some widgets.

Ensures that intentional backslashes (e.g. "\o/") can be used in:

  • Site title
  • Site description
  • Nav menu name
  • Custom Menu widget title
  • Tag Cloud widget title
  • Text widget body if can't unfiltered_html

The latter three are also fixed on the widgets admin page.

Fixes #35898.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/widgets/class-wp-widget-text.php

    r34609 r36622  
    8181        $instance = $old_instance;
    8282        $instance['title'] = sanitize_text_field( $new_instance['title'] );
    83         if ( current_user_can('unfiltered_html') )
    84             $instance['text'] =  $new_instance['text'];
    85         else
    86             $instance['text'] = wp_kses_post( stripslashes( $new_instance['text'] ) );
     83        if ( current_user_can( 'unfiltered_html' ) ) {
     84            $instance['text'] = $new_instance['text'];
     85        } else {
     86            $instance['text'] = wp_kses_post( $new_instance['text'] );
     87        }
    8788        $instance['filter'] = ! empty( $new_instance['filter'] );
    8889        return $instance;
Note: See TracChangeset for help on using the changeset viewer.