Ticket #4719: 4719_4.patch

File 4719_4.patch, 1.6 KB (added by Minh Nguyen, 14 years ago)
  • _source/core/htmlparser/basicwriter.js

     
    6060                 */
    6161                attribute : function( attName, attValue )
    6262                {
    63                         // Browsers don't always escape quote in attribute values. (#4683)
    64                         if ( typeof attValue == 'string' )
    65                                 attValue = attValue.replace( /"/g, '"' );
     63                        // Browsers don't always escape special character in attribute values. (#4683, #4719).
     64                        if ( typeof attValue == 'string' ) {
     65                                attValue = attValue.replace( /"/g, '&quot;' ).replace( /</g, '&lt;' ).replace( />/, '&gt;' ).replace( /'/, '&#039;' );
     66                        }
    6667
    6768                        this._.output.push( ' ', attName, '="', attValue, '"' );
    6869                },
  • _source/plugins/htmlwriter/plugin.js

     
    175175                        if ( typeof attValue == 'string' )
    176176                        {
    177177                                this.forceSimpleAmpersand && ( attValue = attValue.replace( /&amp;/g, '&' ) );
    178                                 // Browsers don't always escape quote in attribute values. (#4683)
    179                                 attValue = attValue.replace( /"/g, '&quot;' );
     178                                // Browsers don't always escape special character in attribute values. (#4683, #4719).
     179                                attValue = attValue.replace( /"/g, '&quot;' ).replace( /</g, '&lt;' ).replace( />/, '&gt;' ).replace( /'/, '&#039;' );
    180180                        }
    181181
    182182                        this._.output.push( ' ', attName, '="', attValue, '"' );
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy