Skip to content

Commit

Permalink
Alphabetize small list and surround in proper double quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsnell committed Oct 3, 2023
1 parent 77b3a5b commit 45c9bd9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions src/wp-includes/class-wp-token-set.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,5 +378,5 @@
// &zwnj &zwj
'zw' => "\x02nj\x01j",
),
'MuNuPiXigegtleltmuneninuorpixi'
"MuNuPiXigegtleltmuneninuorpixi"

Check failure on line 381 in src/wp-includes/html-api/html4wp-named-character-entities.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

String "MuNuPiXigegtleltmuneninuorpixi" does not require double quotes; use single quotes instead
);

0 comments on commit 45c9bd9

Please sign in to comment.