From 33a216930103a344de66a10a274137db1f25f9c7 Mon Sep 17 00:00:00 2001 From: Daniel Kraus Date: Thu, 29 Aug 2013 19:54:57 +0200 Subject: [PATCH] Fix regular expression. The regular expression used to split the page content had a few pipe characters in the wrong places, due to the previous 'cleaning-up' of the convoluted expression for version 2.3.0. --- LinkTitles.body.php | 8 ++++---- LinkTitles.php | 2 +- NEWS | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/LinkTitles.body.php b/LinkTitles.body.php index ed76045..0920a85 100755 --- a/LinkTitles.body.php +++ b/LinkTitles.body.php @@ -107,9 +107,9 @@ if ( $wgLinkTitlesSkipTemplates ) { - $templatesDelimiter = '{{.+?}}'; + $templatesDelimiter = '{{.+?}}|'; } else { - $templatesDelimiter = '{{[^|]+?}}|{{.+\|'; + $templatesDelimiter = '{{[^|]+?}}|{{.+\||'; }; // Build a regular expression that will capture existing wiki links ("[[...]]"), @@ -127,8 +127,8 @@ $templatesDelimiter . // templates (if requested) '^ .+?\n|\n .+?\n|\n .+?$|^ .+?$|' . // preformatted text '.*?<.nowiki>|.*?<\/code>|' . // nowiki/code - '|\[' . $urlPattern . '\s.+?\]|'. $urlPattern . '(?=\s|$)' . // urls - '|(?<=\b)\S+\@(?:\S+\.)+\S+(?=\b)' . // email addresses + '\[' . $urlPattern . '\s.+?\]|'. $urlPattern . '(?=\s|$)|' . // urls + '(?<=\b)\S+\@(?:\S+\.)+\S+(?=\b)' . // email addresses ')/i'; $black_list = str_replace( '_', ' ', diff --git a/LinkTitles.php b/LinkTitles.php index f4ff61e..ad751b3 100755 --- a/LinkTitles.php +++ b/LinkTitles.php @@ -49,7 +49,7 @@ 'name' => 'LinkTitles', 'author' => '[https://www.mediawiki.org/wiki/User:Bovender Daniel Kraus]', 'url' => 'https://www.mediawiki.org/wiki/Extension:LinkTitles', - 'version' => '2.3.0', + 'version' => '2.3.1', 'descriptionmsg' => 'linktitles-desc' ); diff --git a/NEWS b/NEWS index 31923ac..567b468 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +LinkTitles 2.3.1: 2013-08-29 +* Fix bug introduced with 2.3.0 that prevented the extension from working... + LinkTitles 2.3.0: 2013-08-28 * No longer mess up pages if a page title started with a slash. * Do not link preformatted text and text enclosed in or