From 45c9bd988afce3af40476fc9765d13fdb4007237 Mon Sep 17 00:00:00 2001 From: Dennis Snell Date: Tue, 3 Oct 2023 11:27:04 -0700 Subject: [PATCH] Alphabetize small list and surround in proper double quotes --- src/wp-includes/class-wp-token-set.php | 15 ++++++++++++--- .../html-api/html4wp-named-character-entities.php | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/class-wp-token-set.php b/src/wp-includes/class-wp-token-set.php index faffeaedeb6d8..36a809f16a295 100644 --- a/src/wp-includes/class-wp-token-set.php +++ b/src/wp-includes/class-wp-token-set.php @@ -198,9 +198,18 @@ public function precomputed_php_source_table( $indent = "\t" ) { $output .= $data_line; } - $output .= "{$i1}),\n"; - $small_text = str_replace( "\x00", '\x00', $this->small_words ); - $output .= "{$i1}'{$small_text}'\n"; + $output .= "{$i1}),\n"; + + $small_words = array(); + $at = 0; + while ( $at < strlen( $this->small_words ) ) { + $small_words[] = substr( $this->small_words, $at, $this->key_length ); + $at += $this->key_length; + } + sort( $small_words ); + + $small_text = str_replace( "\x00", '\x00', implode( '', $small_words ) ); + $output .= "{$i1}\"{$small_text}\"\n"; $output .= ");\n"; return $output; diff --git a/src/wp-includes/html-api/html4wp-named-character-entities.php b/src/wp-includes/html-api/html4wp-named-character-entities.php index 9d9ce8b3af0af..8f8769e550047 100644 --- a/src/wp-includes/html-api/html4wp-named-character-entities.php +++ b/src/wp-includes/html-api/html4wp-named-character-entities.php @@ -378,5 +378,5 @@ // &zwnj &zwj 'zw' => "\x02nj\x01j", ), - 'MuNuPiXigegtleltmuneninuorpixi' + "MuNuPiXigegtleltmuneninuorpixi" );