mirror of
https://github.com/jquery-validation/jquery-validation.git
synced 2025-12-14 20:35:47 +01:00
Revert "Core: escape errorID only for use in the regex"
This reverts commit b2df81ccb6.
This commit is contained in:
@@ -796,11 +796,11 @@ $.extend( $.validator, {
|
|||||||
// If the element is not a child of an associated label, then it's necessary
|
// If the element is not a child of an associated label, then it's necessary
|
||||||
// to explicitly apply aria-describedby
|
// to explicitly apply aria-describedby
|
||||||
|
|
||||||
errorID = error.attr( "id" );
|
errorID = error.attr( "id" ).replace( /(:|\.|\[|\]|\$)/g, "\\$1");
|
||||||
// Respect existing non-error aria-describedby
|
// Respect existing non-error aria-describedby
|
||||||
if ( !describedBy ) {
|
if ( !describedBy ) {
|
||||||
describedBy = errorID;
|
describedBy = errorID;
|
||||||
} else if ( !describedBy.match( new RegExp( "\\b" + (errorID.replace( /(:|\.|\[|\]|\$)/g, "\\$1")) + "\\b" ) ) ) {
|
} else if ( !describedBy.match( new RegExp( "\\b" + errorID + "\\b" ) ) ) {
|
||||||
// Add to end of list if not already present
|
// Add to end of list if not already present
|
||||||
describedBy += " " + errorID;
|
describedBy += " " + errorID;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user