mirror of
				https://github.com/diocloid/LinkTitles.git
				synced 2025-10-22 05:42:32 +02:00 
			
		
		
		
	Fix change in magic words API
Fix for mediawiki 1.35 Manually running the CLI script caused this error: Error from line 152 of extensions/LinkTitles/includes/Source.php: Call to undefined method MagicWord::get() It seems like an API change so I found this in another extension with the same error https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MagicNoCache/+/574232/2/MagicNoCache.hooks.php
This commit is contained in:
		@@ -149,7 +149,7 @@ class Source {
 | 
			
		||||
	 * @return boolean True if the page contains the __NOAUTOLINKS__ magic word.
 | 
			
		||||
	 */
 | 
			
		||||
	public function hasNoAutolinksMagicWord() {
 | 
			
		||||
		return \MagicWord::get( 'MAG_LINKTITLES_NOAUTOLINKS' )->match( $this->getText() );
 | 
			
		||||
		return \MediaWiki\MediaWikiServices::getInstance()->getMagicWordFactory()->get( 'MAG_LINKTITLES_NOAUTOLINKS' )->match( $this->getText() );
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
 
 | 
			
		||||
@@ -210,7 +210,7 @@ class Target {
 | 
			
		||||
		// page does indeed contain this magic word, return the page title
 | 
			
		||||
		// as-is (unlinked).
 | 
			
		||||
		if ( $this->config->enableNoTargetMagicWord ) {
 | 
			
		||||
			if ( $this->getContent()->matchMagicWord( \MagicWord::get('MAG_LINKTITLES_NOTARGET') ) ) {
 | 
			
		||||
			if ( $this->getContent()->matchMagicWord( \MediaWiki\MediaWikiServices::getInstance()->getMagicWordFactory()->get('MAG_LINKTITLES_NOTARGET') ) ) {
 | 
			
		||||
				return false;
 | 
			
		||||
			}
 | 
			
		||||
		};
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user