WordPress.org

Make WordPress Core

Changeset 38115


Ignore:
Timestamp:
07/20/16 14:25:34 (17 months ago)
Author:
afercia
Message:

Accessibility: Ensure only text is sent to aria-live messages.

While messages passed to wp.speak.a11y() should preferably be meaningful,
short, and carefully crafted case by case, this will ensure any HTML tags will
be stripped out from the message string.

Props adamsilverstein.
Fixes #37382.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/wp-a11y.js

    r37734 r38115  
    2020        // Clear previous messages to allow repeated strings being read out. 
    2121        clear(); 
     22 
     23        // Ensure only text is sent to screen readers. 
     24        message = $( '<p>' ).html( message ).text(); 
    2225 
    2326        if ( $containerAssertive && 'assertive' === ariaLive ) { 
Note: See TracChangeset for help on using the changeset viewer.