Index: /CKEditor/trunk/_source/core/htmlparser/basicwriter.js
===================================================================
--- /CKEditor/trunk/_source/core/htmlparser/basicwriter.js	(revision 5027)
+++ /CKEditor/trunk/_source/core/htmlparser/basicwriter.js	(revision 5028)
@@ -62,5 +62,6 @@
 		{
 			// Browsers don't always escape quote in attribute values. (#4683)
-			attValue = attValue.replace( /"/g, '&quot;' )
+			if ( typeof attValue == 'string' )
+				attValue = attValue.replace( /"/g, '&quot;' )
 
 			this._.output.push( ' ', attName, '="', attValue, '"' );
Index: /CKEditor/trunk/_source/plugins/htmlwriter/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/htmlwriter/plugin.js	(revision 5027)
+++ /CKEditor/trunk/_source/plugins/htmlwriter/plugin.js	(revision 5028)
@@ -175,6 +175,7 @@
 				attValue = attValue.replace( /&amp;/, '&' );
 
-			// Browsers don't always escape quote in attribute values. (#4683) 
-			attValue = attValue.replace( /"/g, '&quot;' )
+			// Browsers don't always escape quote in attribute values. (#4683)
+			if ( typeof attValue == 'string' )
+				attValue = attValue.replace( /"/g, '&quot;' )
 
 			this._.output.push( ' ', attName, '="', attValue, '"' );
