Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html	(revision 6315)
+++ /CKEditor/trunk/CHANGES.html	(revision 6316)
@@ -89,4 +89,5 @@
 		<li><a href="http://dev.ckeditor.com/ticket/6577">#6577</a> : [FF] Selection error when editor element is hidden.</li>
 		<li><a href="http://dev.ckeditor.com/ticket/5500">#5500</a> : [IE] 'value' attribute of text input dialog field was missing.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6665">#6665</a> : [IE] "name" field of link dialog was missing.</li>
 	</ul>
 	<h3>
Index: /CKEditor/trunk/_source/plugins/htmldataprocessor/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/htmldataprocessor/plugin.js	(revision 6315)
+++ /CKEditor/trunk/_source/plugins/htmldataprocessor/plugin.js	(revision 6316)
@@ -93,5 +93,12 @@
 	var defaultDataFilterRules =
 	{
-		elements : {},
+		elements : {
+			a : function( element )
+			{
+				var attrs = element.attributes;
+				if ( attrs && attrs[ 'data-cke-saved-name' ] )
+					attrs[ 'class' ] = ( attrs[ 'class' ] ? attrs[ 'class' ] + ' ' : '' ) + 'cke_anchor';
+			}
+		},
 		attributeNames :
 		[
@@ -289,6 +296,6 @@
 	}
 
-	var protectAttributeRegex = /<((?:a|area|img|input)\b[\s\S]*?\s)((href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+)))([^>]*)>/gi,
-		findSavedSrcRegex = /\sdata-cke-saved-src\s*=/;
+	var protectElementRegex = /<(a|area|img|input)\b([^>]*)>/gi,
+		protectAttributeRegex = /\b(href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi;
 
 	var protectElementsRegex = /(?:<style(?=[ >])[^>]*>[\s\S]*<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,
@@ -302,12 +309,15 @@
 	function protectAttributes( html )
 	{
-		return html.replace( protectAttributeRegex, function( tag, beginning, fullAttr, attrName, end )
-			{
-				// We should not rewrite the _cke_saved_src attribute (#5218)
-				if ( attrName == 'src' && findSavedSrcRegex.test( tag ) )
-					return tag;
-				else
-					return '<' + beginning + fullAttr + ' data-cke-saved-' + fullAttr + end + '>';
-			});
+		return html.replace( protectElementRegex, function( element, tag, attributes )
+		{
+			return '<' +  tag + attributes.replace( protectAttributeRegex, function( fullAttr, attrName )
+			{
+				// We should not rewrite the existed protected attributes, e.g. clipboard content from editor. (#5218)
+				if ( attributes.indexOf( 'data-cke-saved-' + attrName ) == -1 )
+					return ' data-cke-saved-' + fullAttr + ' ' + fullAttr;
+
+				return fullAttr;
+			}) + '>';
+		});
 	}
 
Index: /CKEditor/trunk/_source/plugins/link/dialogs/link.js
===================================================================
--- /CKEditor/trunk/_source/plugins/link/dialogs/link.js	(revision 6315)
+++ /CKEditor/trunk/_source/plugins/link/dialogs/link.js	(revision 6316)
@@ -226,5 +226,9 @@
 			advAttr( 'advLangDir', 'dir' );
 			advAttr( 'advAccessKey', 'accessKey' );
-			advAttr( 'advName', 'name' );
+
+			retval.adv.advName =
+				element.data( 'cke-saved-name' )
+				|| element.getAttribute( 'name' )
+				|| '';
 			advAttr( 'advLangCode', 'lang' );
 			advAttr( 'advTabIndex', 'tabindex' );
@@ -1287,5 +1291,13 @@
 				advAttr( 'advLangDir', 'dir' );
 				advAttr( 'advAccessKey', 'accessKey' );
-				advAttr( 'advName', 'name' );
+
+				if ( data.adv[ 'advName' ] )
+				{
+					attributes[ 'name' ] = attributes[ 'data-cke-saved-name' ] = data.adv[ 'advName' ];
+					attributes[ 'class' ] = ( attributes[ 'class' ] ? attributes[ 'class' ] + ' ' : '' ) + 'cke_anchor';
+				}
+				else
+					removeAttributes = removeAttributes.concat( [ 'data-cke-saved-name', 'name' ] );
+
 				advAttr( 'advLangCode', 'lang' );
 				advAttr( 'advTabIndex', 'tabindex' );
