Skip to content

Escaped submenu toggle aria-label attributes#4546

Merged
selul merged 1 commit into
developmentfrom
bugfix/4503
Jul 21, 2026
Merged

Escaped submenu toggle aria-label attributes#4546
selul merged 1 commit into
developmentfrom
bugfix/4503

Conversation

@girishpanchal30

Copy link
Copy Markdown
Contributor

Summary

Escaped the title for the toggle button in the navigation menu to ensure that it is safe for use in HTML attributes. This prevents potential security vulnerabilities such as XSS attacks.

Check before Pull Request is ready:

Closes #4503

@girishpanchal30
girishpanchal30 requested a review from Copilot July 17, 2026 12:50
@girishpanchal30 girishpanchal30 added the pr-checklist-skip Allow this Pull Request to skip checklist. label Jul 17, 2026
@pirate-bot pirate-bot added the pr-checklist-complete The Pull Request checklist is complete. (automatic label) label Jul 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Escapes dynamic mobile submenu labels to prevent malformed HTML attributes and XSS risks.

Changes:

  • Builds the toggle label separately.
  • Applies attribute-context escaping before rendering.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread inc/views/nav_walker.php
$caret .= $caret_pictogram;
$caret .= '</button>';
$toggle_aria_label = __( 'Toggle', 'neve' ) . ' ' . wp_filter_nohtml_kses( $title );
$caret = '<button ' . $expanded . ' type="button" class="caret-wrap navbar-toggle ' . esc_attr( (string) $item->menu_order ) . ' ' . esc_attr( $additional_class ) . '" style="' . esc_attr( $caret_wrap_css ) . '" aria-label="' . esc_attr( $toggle_aria_label ) . '">';
@pirate-bot

Copy link
Copy Markdown
Collaborator

Plugin build for b66e0d8 is ready 🛎️!

@selul
selul merged commit 51da9a4 into development Jul 21, 2026
17 checks passed
@selul
selul deleted the bugfix/4503 branch July 21, 2026 08:10
@pirate-bot

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 4.2.9 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-checklist-complete The Pull Request checklist is complete. (automatic label) pr-checklist-skip Allow this Pull Request to skip checklist. released Indicate that an issue has been resolved and released in a particular version of the product.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mobile submenu toggle aria-label can break for quoted menu item titles

5 participants