mirror of
				https://github.com/diocloid/LinkTitles.git
				synced 2025-10-22 05:42:32 +02:00 
			
		
		
		
	Fix __NOAUTOLINKS__ magic word.
- Fix: __NOAUTOLINKS__ magic word would not be respected when saving an edited page. Closes #11.
This commit is contained in:
		@@ -71,17 +71,18 @@ class Extension {
 | 
			
		||||
		global $wgLinkTitlesNamespaces;
 | 
			
		||||
		if ( !$wgLinkTitlesParseOnEdit ) return true;
 | 
			
		||||
 | 
			
		||||
		if ( !$isMinor && !\MagicWord::get( 'MAG_LINKTITLES_NOAUTOLINKS' )->match( $text ) ) {
 | 
			
		||||
		if ( !$isMinor ) {
 | 
			
		||||
			$title = $wikiPage->getTitle();
 | 
			
		||||
 | 
			
		||||
			// Only process if page is in one of our namespaces we want to link
 | 
			
		||||
			// Fixes ugly autolinking of sidebar pages 
 | 
			
		||||
			if ( in_array( $title->getNamespace(), $wgLinkTitlesNamespaces ))
 | 
			
		||||
			{
 | 
			
		||||
			if ( in_array( $title->getNamespace(), $wgLinkTitlesNamespaces )) {
 | 
			
		||||
					$text = $content->getContentHandler()->serializeContent( $content );
 | 
			
		||||
					$newText = self::parseContent( $title, $text );
 | 
			
		||||
					if ( $newText != $text ) {
 | 
			
		||||
							$content = $content->getContentHandler()->unserializeContent( $newText );
 | 
			
		||||
					if ( !\MagicWord::get( 'MAG_LINKTITLES_NOAUTOLINKS' )->match( $text ) ) {
 | 
			
		||||
						$newText = self::parseContent( $title, $text );
 | 
			
		||||
						if ( $newText != $text ) {
 | 
			
		||||
								$content = $content->getContentHandler()->unserializeContent( $newText );
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
			}
 | 
			
		||||
		};
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user