mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
In sanitize_post_field(), only run 'attribute' or 'js' escaping when necessary.
Props tfrommen. Fixes #34900. git-svn-id: https://develop.svn.wordpress.org/trunk@37220 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2139,12 +2139,13 @@ function sanitize_post_field( $field, $value, $post_id, $context = 'display' ) {
|
||||
} else {
|
||||
$value = apply_filters( "post_{$field}", $value, $post_id, $context );
|
||||
}
|
||||
}
|
||||
|
||||
if ( 'attribute' == $context )
|
||||
$value = esc_attr($value);
|
||||
elseif ( 'js' == $context )
|
||||
$value = esc_js($value);
|
||||
if ( 'attribute' == $context ) {
|
||||
$value = esc_attr( $value );
|
||||
} elseif ( 'js' == $context ) {
|
||||
$value = esc_js( $value );
|
||||
}
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user