Filter: Escape quotes in select options. See #1527

This commit is contained in:
Rob Garrison 2018-03-15 09:41:24 -05:00
parent 8703f25ba4
commit aa113834db

View File

@ -1783,13 +1783,13 @@
options += '<option'; options += '<option';
for ( val in option ) { for ( val in option ) {
if ( option.hasOwnProperty( val ) && val !== 'text' ) { if ( option.hasOwnProperty( val ) && val !== 'text' ) {
options += ' ' + val + '="' + option[ val ] + '"'; options += ' ' + val + '="' + option[ val ].replace( tsfRegex.quote, '&quot;' ) + '"';
} }
} }
if ( !option.value ) { if ( !option.value ) {
options += ' value="' + option.text + '"'; options += ' value="' + option.text.replace( tsfRegex.quote, '&quot;' ) + '"';
} }
options += '>' + option.text + '</option>'; options += '>' + option.text.replace( tsfRegex.quote, '&quot;' ) + '</option>';
// above code is needed in jQuery < v1.8 // above code is needed in jQuery < v1.8
// make sure we don't turn an object into a string (objects without a "text" property) // make sure we don't turn an object into a string (objects without a "text" property)