Index: /MediaWiki/trunk/FCKeditorParser.body.php
===================================================================
--- /MediaWiki/trunk/FCKeditorParser.body.php	(revision 2465)
+++ /MediaWiki/trunk/FCKeditorParser.body.php	(revision 2466)
@@ -306,9 +306,8 @@
 
 	function replaceInternalLinks( $text ) {
-		$text = preg_replace("/\[\[([^|\[\]]*?)\]\]/", "[[RTENOTITLE$1|$1]]", $text);	//#2223: [[()]]	=>	[[RTENOTITLE%1|%1]]
+		$text = preg_replace("/\[\[([^|\[\]]*?)\]\]/", "[[$1|RTENOTITLE]]", $text);	//#2223: [[()]]	=>	[[%1|RTENOTITLE]]
 		$text = preg_replace("/\[\[:(.*?)\]\]/", "[[RTECOLON$1]]", $text);	//change ':' => 'RTECOLON' in links
 		$text = parent::replaceInternalLinks($text);
-		$text = preg_replace("/<strong class=\"selflink\">(.*?)<\/strong>/", "<a href=\"".$this->mTitle->mDbkeyform."\" class=\"selflink\">$1</a>", $text);				// #2075
-		$text = preg_replace("/\[\[RTENOTITLE(.*?)\|/", "[[", $text);				// remove unused RTENOTITLE
+		$text = preg_replace("/\|RTENOTITLE\]\]/", "]]", $text);				// remove unused RTENOTITLE
 
 		return $text;
@@ -469,9 +468,14 @@
 			$appendString = "";
 			foreach ($categories as $cat=>$val) {
+				$args = '';
+				if( $val == 'RTENOTITLE' ){
+						$args .= '_fcknotitle="true" ';
+					$val = $cat;
+				}
 				if ($val != $title->mTextform) {
-					$appendString .= "<a href=\"Category:" . $cat ."\">" . $val ."</a> ";
+					$appendString .= "<a ".$args."href=\"Category:" . $cat ."\">" . $val ."</a> ";
 				}
 				else {
-					$appendString .= "<a href=\"Category:" . $cat ."\">Category:" . $cat ."</a> ";
+					$appendString .= "<a ".$args."href=\"Category:" . $cat ."\">Category:" . $cat ."</a> ";
 				}
 			}
Index: /MediaWiki/trunk/FCKeditorSkin.body.php
===================================================================
--- /MediaWiki/trunk/FCKeditorSkin.body.php	(revision 2465)
+++ /MediaWiki/trunk/FCKeditorSkin.body.php	(revision 2466)
@@ -24,4 +24,8 @@
 		$imgName = $img->getName();
 		$found = $img->getURL();
+
+		if (!is_null($alt) && ( $alt == 'RTENOTITLE' ))  {		//2223
+			$alt = '';
+		}
 
 		if ($found) {
@@ -126,4 +130,7 @@
 		$found = $img->getURL();
 
+		if( $frameParams['alt'] == 'RTENOTITLE' ){	//2223
+			$frameParams['alt'] = '';
+		}
 		if ($found) {
 			$linker = new Linker();
@@ -213,9 +220,42 @@
 		return $ret;
 	}
-
+	
+	function makeLinkObj( $nt, $text= '', $query = '', $trail = '', $prefix = '' ) {
+		global $wgUser;
+
+		wfProfileIn( __METHOD__ );
+		if ( $nt->isExternal() ) {
+			$args = '';
+			$u = $nt->getFullURL();
+			$link = $nt->getPrefixedURL();
+			if ( '' == $text ) { $text = $nt->getPrefixedText(); }
+			$style = $this->getInterwikiLinkAttributes( $link, $text, 'extiw' );
+
+			$inside = '';
+			if ( '' != $trail ) {
+				$m = array();
+				if ( preg_match( '/^([a-z]+)(.*)$$/sD', $trail, $m ) ) {
+					$inside = $m[1];
+					$trail = $m[2];
+				}
+			}
+			if( $text == 'RTENOTITLE' ) {	//2223
+				$text = $u = $link;
+				$args .= '_fcknotitle="true" ';
+			}
+			$t = "<a {$args}href=\"{$u}\"{$style}>{$text}{$inside}</a>";
+
+			wfProfileOut( __METHOD__ );
+			return $t;
+		}
+		
+		return Linker::makeLinkObj($nt, $text, $query, $trail, $prefix);
+	
+	}
 	function makeKnownLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' , $aprops = '', $style = '' ) {
 		$fname = 'FCKeditorSkin::makeKnownLinkObj';
 		wfProfileIn( $fname );
 
+		$args = '';
 		if ( !is_object( $nt ) ) {
 			wfProfileOut( $fname );
@@ -224,5 +264,7 @@
 
 		//$u = $nt->escapeLocalURL( $query );
-		$u = $nt->getFullText();
+	  $u = $nt->getFullText();
+	  //#Updating links tables -> #Updating_links_tables
+	  $u = str_replace("#".$nt->getFragment(), $nt->getFragmentForURL(), $u);
 
 		if ( $nt->getFragment() != '' ) {
@@ -250,5 +292,14 @@
 
 		list( $inside, $trail ) = Linker::splitTrail( $trail );
-		$r = "<a href=\"{$u}\">{$prefix}{$text}{$inside}</a>{$trail}";
+		$title = "{$prefix}{$text}{$inside}";
+
+		$u = preg_replace("/^RTECOLON/", ":", $u);	//change 'RTECOLON' => ':'
+		if( substr($text, 0, 10) == 'RTENOTITLE' ){		//starts with RTENOTITLE
+			$args .= '_fcknotitle="true" ';
+			$title = $u;
+			$trail = substr($text, 10).$trail;
+		}
+
+		$r = "<a {$args}href=\"{$u}\">{$title}</a>{$trail}";
 		wfProfileOut( $fname );
 		return $r;
@@ -261,9 +312,12 @@
 			return "<!-- ERROR -->{$prefix}{$text}{$trail}";
 		}
+		$args = '';
 
 		$fname = 'FCKeditorSkin::makeBrokenLinkObj';
 		wfProfileIn( $fname );
 
-		$u = $nt->getFullText();
+	  $u = $nt->getFullText();
+	  //#Updating links tables -> #Updating_links_tables
+	  $u = str_replace("#".$nt->getFragment(), $nt->getFragmentForURL(), $u);
 
 		if ( '' == $text ) {
@@ -275,8 +329,30 @@
 
 		list( $inside, $trail ) = Linker::splitTrail( $trail );
-		$s = "<a href=\"{$u}\">{$prefix}{$text}{$inside}</a>{$trail}";
+		$title = "{$prefix}{$text}{$inside}";
+
+		$u = preg_replace("/^RTECOLON/", ":", $u);	//change 'RTECOLON' => ':'
+		if( substr($text, 0, 10) == 'RTENOTITLE' ){		//starts with RTENOTITLE
+			$args .= '_fcknotitle="true" ';
+			$title = $u;
+			$trail = substr($text, 10).$trail;
+		}
+		$s = "<a {$args}href=\"{$u}\">{$title}</a>{$trail}";
 
 		wfProfileOut( $fname );
 		return $s;
+	}
+
+	function makeSelfLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
+		$args = '';
+		if ( '' == $text ) {
+			$text = $nt->mDbkeyform;
+		}
+		list( $inside, $trail ) = Linker::splitTrail( $trail );
+		$title = "{$prefix}{$text}";
+		if( $text == 'RTENOTITLE' ){			//2223
+			$args .= '_fcknotitle="true" ';
+			$title = $nt->mDbkeyform;
+		}
+		return "<a {$args}href=\"".$nt->mDbkeyform."\" class=\"selflink\">{$title}</a>{$inside}{$trail}";
 	}
 
@@ -296,4 +372,5 @@
 			return $text;
 		} else {
+			$args = '';
 			$orginal = $title->getPartialURL();
 			// Mediawiki 1.11
@@ -325,6 +402,11 @@
 				$text = $alt;
 			}
-			$u = htmlspecialchars( $url );
-			return "<a href=\"{$orginal}\" class=\"$class\" _fck_mw_filename=\"{$orginal}\" _fck_mw_type=\"media\" title=\"{$alt}\">{$text}</a>";
+			$orginal = preg_replace("/^RTECOLON/", ":", $orginal);	//change 'RTECOLON' => ':'
+			if( $text == 'RTENOTITLE' ){			//2223
+				$args .= '_fcknotitle="true" ';
+				$text = $orginal;
+				$alt = $orginal;
+			}
+			return "<a href=\"{$orginal}\" class=\"$class\" {$args} _fck_mw_filename=\"{$orginal}\" _fck_mw_type=\"media\" title=\"{$alt}\">{$text}</a>";
 		}
 	}
@@ -335,8 +417,14 @@
 			$text = htmlspecialchars( $text );
 		}
+		$url = preg_replace("/^RTECOLON/", ":", $url);	//change 'RTECOLON' => ':'
 		if ($linktype == 'autonumber') {
 			return '<a href="'.$url.'">[n]</a>';
 		}
-		return '<a href="'.$url.'">'.$text.'</a>';
+		$args = '';
+		if( $text == 'RTENOTITLE' ){								//2223
+			$args .= '_fcknotitle="true" ';
+			$text = $url;
+		}
+		return '<a '.$args.'href="'.$url.'">'.$text.'</a>';
 	}
 
Index: /MediaWiki/trunk/mw12/FCKeditorParser_OldPP.body.php
===================================================================
--- /MediaWiki/trunk/mw12/FCKeditorParser_OldPP.body.php	(revision 2465)
+++ /MediaWiki/trunk/mw12/FCKeditorParser_OldPP.body.php	(revision 2466)
@@ -307,9 +307,8 @@
 
 	function replaceInternalLinks( $text ) {
-		$text = preg_replace("/\[\[([^|\[\]]*?)\]\]/", "[[RTENOTITLE$1|$1]]", $text);	//#2223: [[()]]	=>	[[RTENOTITLE%1|%1]]
+		$text = preg_replace("/\[\[([^|\[\]]*?)\]\]/", "[[$1|RTENOTITLE]]", $text);	//#2223: [[()]]	=>	[[%1|RTENOTITLE]]
 		$text = preg_replace("/\[\[:(.*?)\]\]/", "[[RTECOLON$1]]", $text);	//change ':' => 'RTECOLON' in links
 		$text = parent::replaceInternalLinks($text);
-		$text = preg_replace("/<strong class=\"selflink\">(.*?)<\/strong>/", "<a href=\"".$this->mTitle->mDbkeyform."\" class=\"selflink\">$1</a>", $text);				// #2075
-		$text = preg_replace("/\[\[RTENOTITLE(.*?)\|/", "[[", $text);				// remove unused RTENOTITLE
+		$text = preg_replace("/\|RTENOTITLE\]\]/", "]]", $text);				// remove unused RTENOTITLE
 
 		return $text;
@@ -470,9 +469,14 @@
 			$appendString = "";
 			foreach ($categories as $cat=>$val) {
+				$args = '';
+				if( $val == 'RTENOTITLE' ){
+						$args .= '_fcknotitle="true" ';
+					$val = $cat;
+				}
 				if ($val != $title->mTextform) {
-					$appendString .= "<a href=\"Category:" . $cat ."\">" . $val ."</a> ";
+					$appendString .= "<a ".$args."href=\"Category:" . $cat ."\">" . $val ."</a> ";
 				}
 				else {
-					$appendString .= "<a href=\"Category:" . $cat ."\">Category:" . $cat ."</a> ";
+					$appendString .= "<a ".$args."href=\"Category:" . $cat ."\">Category:" . $cat ."</a> ";
 				}
 			}
Index: /MediaWiki/trunk/plugins/mediawiki/dialogs/link.html
===================================================================
--- /MediaWiki/trunk/plugins/mediawiki/dialogs/link.html	(revision 2465)
+++ /MediaWiki/trunk/plugins/mediawiki/dialogs/link.html	(revision 2466)
@@ -71,9 +71,4 @@
 		
 	sHRef = FCKConfig.ProtectedSource.Revert(sHRef, 0);		//#2509
-	if (sHRef.toLowerCase().StartsWith( 'rtenotitle' ) )
-	{
-		sHRef = sHRef.substring(10);
-		bLinkEqualsName = true;
-	}
 		
 	if ( sHRef == oLink.innerHTML )
@@ -190,7 +185,4 @@
 	sUri  = FCKConfig.ProtectedSource.Protect(sUri);		//#2509
 	var realUri = sUri;
-	if ( bLinkEqualsName ) {
-		sUri = 'RTENOTITLE'+ sUri;
-	}
 	if (sUri.StartsWith( ':' ) )
 		sUri = sUri.replace(/:/, "rtecolon");
Index: /MediaWiki/trunk/plugins/mediawiki/fckplugin.js
===================================================================
--- /MediaWiki/trunk/plugins/mediawiki/fckplugin.js	(revision 2465)
+++ /MediaWiki/trunk/plugins/mediawiki/fckplugin.js	(revision 2466)
@@ -368,8 +368,10 @@
 							}
 							//#2223
-							if (href.toLowerCase().StartsWith( 'rtenotitle' ))
-							{
-								href = href.substring(10);
-								if ( FCKConfig.ProtectedSource.Revert(htmlNode.innerHTML, 0) == FCKConfig.ProtectedSource.Revert(href, 0) ) pipeline = false;
+							if (htmlNode.getAttribute( '_fcknotitle' ) && htmlNode.getAttribute( '_fcknotitle' ) == "true")
+							{
+								var testInner = FCKConfig.ProtectedSource.Revert(htmlNode.innerHTML, 0);
+								if (href.toLowerCase().StartsWith( 'category:' )) testInner = 'Category:'+testInner;
+								testInner = testInner.replace(/&amp;/, "&") 
+								if ( testInner == FCKConfig.ProtectedSource.Revert(href, 0) ) pipeline = false;
 							}
 							if (href.toLowerCase().StartsWith( 'rtecolon' ))		//change 'rtecolon=' => ':' in links
@@ -930,6 +932,6 @@
 		if (a.className == 'extiw')
 		{
-			 a.href = ":" + a.title ;
-			 a.setAttribute( '_fcksavedurl', ":" + a.title ) ;
+			 a.href = a.title ;
+			 a.setAttribute( '_fcksavedurl', a.href ) ;
 		}
 		else
