diff options
-rw-r--r-- | src/wp-admin/nav-menus.php | 14 | ||||
-rw-r--r-- | src/wp-includes/class-wp-query.php | 2 | ||||
-rw-r--r-- | src/wp-includes/embed.php | 2 | ||||
-rw-r--r-- | src/wp-includes/taxonomy.php | 2 | ||||
-rw-r--r-- | tests/phpunit/tests/kses.php | 71 |
5 files changed, 70 insertions, 21 deletions
diff --git a/src/wp-admin/nav-menus.php b/src/wp-admin/nav-menus.php index 82c8e264ad..ea76404c2e 100644 --- a/src/wp-admin/nav-menus.php +++ b/src/wp-admin/nav-menus.php @@ -1122,14 +1122,12 @@ require_once ABSPATH . 'wp-admin/admin-header.php'; <p><?php echo $starter_copy; ?></p> </div> - <?php if ( ! $add_new_screen ) : ?> - <div id="nav-menu-bulk-actions-top" class="bulk-actions" <?php echo $hide_style; ?>> - <label class="bulk-select-button" for="bulk-select-switcher-top"> - <input type="checkbox" id="bulk-select-switcher-top" name="bulk-select-switcher-top" class="bulk-select-switcher"> - <span class="bulk-select-button-label"><?php _e( 'Bulk Select' ); ?></span> - </label> - </div> - <?php endif; ?> + <div id="nav-menu-bulk-actions-top" class="bulk-actions" <?php echo $hide_style; ?>> + <label class="bulk-select-button" for="bulk-select-switcher-top"> + <input type="checkbox" id="bulk-select-switcher-top" name="bulk-select-switcher-top" class="bulk-select-switcher"> + <span class="bulk-select-button-label"><?php _e( 'Bulk Select' ); ?></span> + </label> + </div> <?php if ( isset( $edit_markup ) && ! is_wp_error( $edit_markup ) ) { diff --git a/src/wp-includes/class-wp-query.php b/src/wp-includes/class-wp-query.php index 21127dc755..52121e2308 100644 --- a/src/wp-includes/class-wp-query.php +++ b/src/wp-includes/class-wp-query.php @@ -5005,7 +5005,7 @@ class WP_Query { * * These arrays are sorted in the query generator for the purposes of the * WHERE clause but the arguments are not modified as they can be used for - * the orderby clase. + * the orderby clause. * * Their use in the orderby clause will generate a different SQL query so * they can be sorted for the cache key generation. diff --git a/src/wp-includes/embed.php b/src/wp-includes/embed.php index c38a079003..6ef190d0ea 100644 --- a/src/wp-includes/embed.php +++ b/src/wp-includes/embed.php @@ -791,7 +791,7 @@ function _oembed_rest_pre_serve_request( $served, $result, $request, $server ) { // Bail if there's no XML. if ( ! $result ) { status_header( 501 ); - return get_status_header_desc( 501 ); + die( get_status_header_desc( 501 ) ); } if ( ! headers_sent() ) { diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php index 935212652c..70b407fda8 100644 --- a/src/wp-includes/taxonomy.php +++ b/src/wp-includes/taxonomy.php @@ -1337,7 +1337,7 @@ function get_terms( $args = array(), $deprecated = '' ) { $args['taxonomy'] = $taxonomies; } else { $args = wp_parse_args( $args, $defaults ); - if ( isset( $args['taxonomy'] ) && null !== $args['taxonomy'] ) { + if ( isset( $args['taxonomy'] ) ) { $args['taxonomy'] = (array) $args['taxonomy']; } } diff --git a/tests/phpunit/tests/kses.php b/tests/phpunit/tests/kses.php index 256a3866ec..61baf0d0a1 100644 --- a/tests/phpunit/tests/kses.php +++ b/tests/phpunit/tests/kses.php @@ -551,18 +551,69 @@ EOF; } /** + * Data provider. + */ + public static function data_normalize_entities(): array { + return array( + /** + * These examples are from the wp_kses_normalize_entities function description. + */ + 'AT&T' => array( 'AT&T', 'AT&T' ), + ':' => array( ':', ':' ), + '&#XYZZY;' => array( '&#XYZZY;', '&#XYZZY;' ), + + 'Named ref &' => array( '♠', '♠' ), + 'Named ref &' => array( '♠', '♠' ), + 'Named ref ♠' => array( '♠', '♠' ), + 'Named ref ¹' => array( '¹', '¹' ), + 'Named ref ²' => array( '²', '²' ), + 'Named ref ³' => array( '³', '³' ), + 'Named ref ¼' => array( '¼', '¼' ), + 'Named ref ½' => array( '½', '½' ), + 'Named ref ¾' => array( '¾', '¾' ), + 'Named ref ∴' => array( '∴', '∴' ), + + 'Decimal ref 	 ( )' => array( '	', '	' ), + 'Decimal ref " (")' => array( '"', '"' ), + 'Decimal ref " (")' => array( '"', '"' ), + 'Decimal ref & (&)' => array( '&', '&' ), + "Decimal ref ' (')" => array( ''', ''' ), + 'Decimal ref 😍 (😍)' => array( '😍', '😍' ), + 'Decimal ref 😍 (😍)' => array( '😍', '😍' ), + + 'Hex ref 	 ( )' => array( '	', '	' ), + 'Hex ref " (")' => array( '"', '"' ), + 'Hex ref " (")' => array( '"', '"' ), + 'Hex ref & (&)' => array( '&', '&' ), + "Hex ref ' (')" => array( ''', ''' ), + 'Hex ref 😍 (😍)' => array( '😍', '😍' ), + 'Hex ref 😍 (😍)' => array( '😍', '😍' ), + + 'HEX REF " (")' => array( '"', '"' ), + 'HEX REF & (&)' => array( '&', '&' ), + "HEX REF ' (')" => array( ''', ''' ), + 'HEX REF 😍 (😍)' => array( '😍', '😍' ), + + 'Encoded named ref &amp;' => array( '&amp;', '&amp;' ), + 'Encoded named ref &amp;' => array( '&amp;', '&amp;' ), + 'Encoded named ref &amp;' => array( '&amp;', '&amp;' ), + + /* + * The codepoint value here is outside of the valid unicode range whose + * maximum is 0x10FFFF or 1114111. + */ + 'Invalid decimal unicode �' => array( '�', '&#1114112;' ), + 'Invalid hex unicode �' => array( '�', '&#x110000;' ), + ); + } + + /** * @ticket 26290 + * + * @dataProvider data_normalize_entities */ - public function test_wp_kses_normalize_entities() { - $this->assertSame( '♠', wp_kses_normalize_entities( '♠' ) ); - - $this->assertSame( '¹', wp_kses_normalize_entities( '¹' ) ); - $this->assertSame( '²', wp_kses_normalize_entities( '²' ) ); - $this->assertSame( '³', wp_kses_normalize_entities( '³' ) ); - $this->assertSame( '¼', wp_kses_normalize_entities( '¼' ) ); - $this->assertSame( '½', wp_kses_normalize_entities( '½' ) ); - $this->assertSame( '¾', wp_kses_normalize_entities( '¾' ) ); - $this->assertSame( '∴', wp_kses_normalize_entities( '∴' ) ); + public function test_wp_kses_normalize_entities( string $input, string $expected ) { + $this->assertSame( $expected, wp_kses_normalize_entities( $input ) ); } /** |