Merge branch 'release-4.0.3'

This commit is contained in:
Daniel Kraus
2016-11-22 22:05:07 +01:00
3 changed files with 16 additions and 7 deletions

8
NEWS
View File

@ -1,3 +1,11 @@
Version 4.0.3 (2016-11-22)
------------------------------------------------------------------------
- Fix: __NOAUTOLINKS__ magic word would not be respected when saving an edited page.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Version 4.0.2 (2016-11-09) Version 4.0.2 (2016-11-09)
------------------------------------------------------------------------ ------------------------------------------------------------------------

View File

@ -6,7 +6,7 @@
], ],
"type": "parserhook", "type": "parserhook",
"url": "https://www.mediawiki.org/wiki/Extension:LinkTitles", "url": "https://www.mediawiki.org/wiki/Extension:LinkTitles",
"version": "4.0.2", "version": "4.0.3",
"license-name": "GPL-2.0+", "license-name": "GPL-2.0+",
"descriptionmsg": "linktitles-desc", "descriptionmsg": "linktitles-desc",
"requires": { "requires": {

View File

@ -71,17 +71,18 @@ class Extension {
global $wgLinkTitlesNamespaces; global $wgLinkTitlesNamespaces;
if ( !$wgLinkTitlesParseOnEdit ) return true; if ( !$wgLinkTitlesParseOnEdit ) return true;
if ( !$isMinor && !\MagicWord::get( 'MAG_LINKTITLES_NOAUTOLINKS' )->match( $text ) ) { if ( !$isMinor ) {
$title = $wikiPage->getTitle(); $title = $wikiPage->getTitle();
// Only process if page is in one of our namespaces we want to link // Only process if page is in one of our namespaces we want to link
// Fixes ugly autolinking of sidebar pages // Fixes ugly autolinking of sidebar pages
if ( in_array( $title->getNamespace(), $wgLinkTitlesNamespaces )) if ( in_array( $title->getNamespace(), $wgLinkTitlesNamespaces )) {
{
$text = $content->getContentHandler()->serializeContent( $content ); $text = $content->getContentHandler()->serializeContent( $content );
$newText = self::parseContent( $title, $text ); if ( !\MagicWord::get( 'MAG_LINKTITLES_NOAUTOLINKS' )->match( $text ) ) {
if ( $newText != $text ) { $newText = self::parseContent( $title, $text );
$content = $content->getContentHandler()->unserializeContent( $newText ); if ( $newText != $text ) {
$content = $content->getContentHandler()->unserializeContent( $newText );
}
} }
} }
}; };