Skip to content

Commit

Permalink
Allow all formatting tags to be returned in submit error response
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Feb 2, 2018
1 parent 17ab3fd commit 92f3a76
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions includes/amp-helper-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,10 @@ function amp_handle_xhr_headers_output() {
if ( is_wp_error( $error ) ) {
$error = $error->get_error_message();
}
$error = strip_tags( $error, 'strong' );
wp_send_json( compact( 'error' ) );
$amp_mustache_allowed_html_tags = array( 'strong', 'b', 'em', 'i', 'u', 's', 'small', 'mark', 'del', 'ins', 'sup', 'sub' );
wp_send_json( array(
'error' => wp_kses( $error, array_fill_keys( $amp_mustache_allowed_html_tags, array() ) ),
) );
};
} );

Expand Down

0 comments on commit 92f3a76

Please sign in to comment.