Skip to content

Commit e2db788

Browse files
committed
Add question about limiting the list of allowable names
1 parent 16faaa4 commit e2db788

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/wp-includes/formatting.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,13 @@ function _esc_attr_single_pass_utf8( $text ) {
11621162
$semicolon_delta = ';' === $name[ $name_length - 1 ] ? -1 : 0;
11631163
$reference_name = substr( $text, $at + 1, $name_at - ( $at + 1 ) + $semicolon_delta );
11641164

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

0 commit comments

Comments
 (0)