X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/4feeb71a9d812a9ae371c28a3d8b442a4394ded7..607b7e02d77e7326161e8ec15639052d2040f745:/wp-includes/class-wp-admin-bar.php
diff --git a/wp-includes/class-wp-admin-bar.php b/wp-includes/class-wp-admin-bar.php
index b89c6542..49986ac2 100644
--- a/wp-includes/class-wp-admin-bar.php
+++ b/wp-includes/class-wp-admin-bar.php
@@ -27,7 +27,7 @@ class WP_Admin_Bar {
return is_ssl() ? 'https://' : 'http://';
case 'menu' :
- _deprecated_argument( 'WP_Admin_Bar', '3.3', 'Modify admin bar nodes with WP_Admin_Bar::get_node(), WP_Admin_Bar::add_node(), and WP_Admin_Bar::remove_node(), not the menu
property.' );
+ _deprecated_argument( 'WP_Admin_Bar', '3.3.0', 'Modify admin bar nodes with WP_Admin_Bar::get_node(), WP_Admin_Bar::add_node(), and WP_Admin_Bar::remove_node(), not the menu
property.' );
return array(); // Sorry, folks.
}
}
@@ -127,7 +127,7 @@ class WP_Admin_Bar {
if ( empty( $args['title'] ) )
return;
- _doing_it_wrong( __METHOD__, __( 'The menu ID should not be empty.' ), '3.3' );
+ _doing_it_wrong( __METHOD__, __( 'The menu ID should not be empty.' ), '3.3.0' );
// Deprecated: Generate an ID from the title.
$args['id'] = esc_attr( sanitize_title( trim( $args['title'] ) ) );
}
@@ -477,8 +477,9 @@ class WP_Admin_Bar {
$is_parent = ! empty( $node->children );
$has_link = ! empty( $node->href );
- $tabindex = isset( $node->meta['tabindex'] ) ? (int) $node->meta['tabindex'] : '';
- $aria_attributes = $tabindex ? 'tabindex="' . $tabindex . '"' : '';
+ // Allow only numeric values, then casted to integers, and allow a tabindex value of `0` for a11y.
+ $tabindex = ( isset( $node->meta['tabindex'] ) && is_numeric( $node->meta['tabindex'] ) ) ? (int) $node->meta['tabindex'] : '';
+ $aria_attributes = ( '' !== $tabindex ) ? ' tabindex="' . $tabindex . '"' : '';
$menuclass = '';
@@ -497,7 +498,7 @@ class WP_Admin_Bar {