Skip to content

Commit

Permalink
Add question about limiting the list of allowable names
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsnell committed Oct 1, 2023
1 parent 16faaa4 commit e2db788
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/wp-includes/formatting.php
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,13 @@ function _esc_attr_single_pass_utf8( $text ) {
$semicolon_delta = ';' === $name[ $name_length - 1 ] ? -1 : 0;
$reference_name = substr( $text, $at + 1, $name_at - ( $at + 1 ) + $semicolon_delta );

// Some names are not allowed by WordPress, even though they are permitted by HTML.
/*
* Some names are not allowed by WordPress, even though they are permitted by HTML.
*
* @TODO: Is there a reason these are limited, or was it simply that not all of the
* original named character references were added? Is there a reason not to
* allow all of them? There don't seem to be plugins changing this list.
*/
if ( ! in_array( $reference_name, $allowedentitynames, true ) ) {
$output .= '&' . substr( $text, $at + 1, $name_at - ( $at + 1 ) );
$at = $name_at;
Expand Down

0 comments on commit e2db788

Please sign in to comment.