Changeset 3151
- Timestamp:
- 05/16/2016 12:57:32 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/style/trac/wp-trac.js
r3141 r3151 52 52 ]; 53 53 54 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Using_special_characters 55 function escapeRegExp( string ) { 56 return string.replace( /[.*+?^${}()|[\]\\]/g, '\\$&' ); 57 } 58 54 59 wpTrac = { 55 60 … … 108 113 } 109 114 110 var matchInAttr = new RegExp( '=".*' + match+ '.*"' );115 var matchInAttr = new RegExp( '=".*' + escapeRegExp( match ) + '.*"' ); 111 116 if ( matchInAttr.test( $comment ) ) { 112 117 return match;
Note: See TracChangeset
for help on using the changeset viewer.