Index: FCKeditorParser.body.php
===================================================================
--- FCKeditorParser.body.php	(wersja 2442)
+++ FCKeditorParser.body.php	(kopia robocza)
@@ -305,11 +305,10 @@
 	}
 
 	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;
 	}
@@ -468,11 +467,16 @@
 		if ($categories) {
 			$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> ";
 				}
 			}
 			$parserOutput->setText($parserOutput->getText() . $appendString);
Index: FCKeditorSkin.body.php
===================================================================
--- FCKeditorSkin.body.php	(wersja 2441)
+++ FCKeditorSkin.body.php	(kopia robocza)
@@ -24,6 +24,10 @@
 		$imgName = $img->getName();
 		$found = $img->getURL();
 
+		if (!is_null($alt) && ( $alt == 'RTENOTITLE' ))  {		//2223
+			$alt = '';
+		}
+
 		if ($found) {
 			//trick to get real Url for image:
 			$originalLink = strip_tags(Linker::makeImageLinkObj($nt, $label, $alt, $align , $params , $framed , $thumb , $manual_thumb , $valign ), "<img>");
@@ -125,6 +129,9 @@
 		$imgName = $img->getName();
 		$found = $img->getURL();
 
+		if( $frameParams['alt'] == 'RTENOTITLE' ){	//2223
+			$frameParams['alt'] = '';
+		}
 		if ($found) {
 			$linker = new Linker();
 			$originalLink = $linker->makeImageLink2( $nt, $file, $frameParams, $handlerParams);
@@ -212,11 +219,44 @@
 
 		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;
+				$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 );
 			return $text;
@@ -249,7 +289,16 @@
 		}
 
 		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;
 	}
@@ -260,6 +309,7 @@
 			# throw new MWException();
 			return "<!-- ERROR -->{$prefix}{$text}{$trail}";
 		}
+		$args = '';
 
 		$fname = 'FCKeditorSkin::makeBrokenLinkObj';
 		wfProfileIn( $fname );
@@ -274,12 +324,33 @@
 		}
 
 		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 = '' ) {
+		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}";
+	}
+
 	/**
 	 * Create a direct link to a given uploaded file.
 	 *
@@ -295,6 +366,7 @@
 			### HOTFIX. Instead of breaking, return empty string.
 			return $text;
 		} else {
+			$args = '';
 			$orginal = $title->getPartialURL();
 			// Mediawiki 1.11
 			if ( function_exists('wfFindFile') ) {
@@ -324,8 +396,13 @@
 			if( $text == '' ) {
 				$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>";
 		}
 	}
 
@@ -334,10 +411,16 @@
 		if( $escape ) {
 			$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>';
 	}
 
 	function __call( $m, $a) {
Index: mw12/FCKeditorParser_OldPP.body.php
===================================================================
--- mw12/FCKeditorParser_OldPP.body.php	(wersja 2442)
+++ mw12/FCKeditorParser_OldPP.body.php	(kopia robocza)
@@ -306,11 +306,10 @@
 	}
 
 	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,11 +468,16 @@
 		if ($categories) {
 			$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> ";
 				}
 			}
 			$parserOutput->setText($parserOutput->getText() . $appendString);
Index: plugins/mediawiki/dialogs/link.html
===================================================================
--- plugins/mediawiki/dialogs/link.html	(wersja 2441)
+++ plugins/mediawiki/dialogs/link.html	(kopia robocza)
@@ -70,11 +70,6 @@
 		sHRef = oLink.getAttribute( 'href' , 2 ) || '' ;
 		
 	sHRef = FCKConfig.ProtectedSource.Revert(sHRef, 0);		//#2509
-	if (sHRef.toLowerCase().StartsWith( 'rtenotitle' ) )
-	{
-		sHRef = sHRef.substring(10);
-		bLinkEqualsName = true;
-	}
 		
 	if ( sHRef == oLink.innerHTML )
 		bLinkEqualsName = true ;
@@ -189,9 +184,6 @@
 	var sUri = GetE('txtUrl').value ;
 	sUri  = FCKConfig.ProtectedSource.Protect(sUri);		//#2509
 	var realUri = sUri;
-	if ( bLinkEqualsName ) {
-		sUri = 'RTENOTITLE'+ sUri;
-	}
 	if (sUri.StartsWith( ':' ) )
 		sUri = sUri.replace(/:/, "rtecolon");
 	var sInnerHtml ;
Index: plugins/mediawiki/fckplugin.js
===================================================================
--- plugins/mediawiki/fckplugin.js	(wersja 2442)
+++ plugins/mediawiki/fckplugin.js	(kopia robocza)
@@ -367,10 +367,12 @@
 								stringBuilder.push( isWikiUrl ? '[[' : '[' ) ;
 							}
 							//#2223
-							if (href.toLowerCase().StartsWith( 'rtenotitle' ))
+							if (htmlNode.getAttribute( '_fcknotitle' ) && htmlNode.getAttribute( '_fcknotitle' ) == "true")
 							{
-								href = href.substring(10);
-								if ( FCKConfig.ProtectedSource.Revert(htmlNode.innerHTML, 0) == FCKConfig.ProtectedSource.Revert(href, 0) ) pipeline = false;
+								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
 							{
