Make WordPress Core

Changeset 37220


Ignore:
Timestamp:
04/16/2016 02:51:01 PM (8 years ago)
Author:
boonebgorges
Message:

In sanitize_post_field(), only run 'attribute' or 'js' escaping when necessary.

Props tfrommen.
Fixes #34900.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r37165 r37220  
    21402140            $value = apply_filters( "post_{$field}", $value, $post_id, $context );
    21412141        }
    2142     }
    2143 
    2144     if ( 'attribute' == $context )
    2145         $value = esc_attr($value);
    2146     elseif ( 'js' == $context )
    2147         $value = esc_js($value);
     2142
     2143        if ( 'attribute' == $context ) {
     2144            $value = esc_attr( $value );
     2145        } elseif ( 'js' == $context ) {
     2146            $value = esc_js( $value );
     2147        }
     2148    }
    21482149
    21492150    return $value;
Note: See TracChangeset for help on using the changeset viewer.