- if ( this.forceSimpleAmpersand )\r
- attValue = attValue.replace( /&/, '&' );\r
+\r
+ if ( typeof attValue == 'string' )\r
+ {\r
+ this.forceSimpleAmpersand && ( attValue = attValue.replace( /&/g, '&' ) );\r
+ // Browsers don't always escape special character in attribute values. (#4683, #4719).\r
+ attValue = CKEDITOR.tools.htmlEncodeAttr( attValue );\r
+ }\r