mirror of
https://github.com/diocloid/LinkTitles.git
synced 2025-07-13 01:39:30 +02:00
Add option $wgLinkTitlesIgnoreCase to enable case-sensitive linking of page titles.
This commit is contained in:
@ -79,9 +79,11 @@
|
||||
global $wgLinkTitlesFirstOnly;
|
||||
global $wgLinkTitlesWordStartOnly;
|
||||
global $wgLinkTitlesWordEndOnly;
|
||||
global $wgLinkTitlesIgnoreCase;
|
||||
|
||||
( $wgLinkTitlesWordStartOnly ) ? $wordStartDelim = '\b' : $wordStartDelim = '';
|
||||
( $wgLinkTitlesWordEndOnly ) ? $wordEndDelim = '\b' : $wordEndDelim = '';
|
||||
( $wgLinkTitlesIgnoreCase ) ? $regexModifier = 'i' : $regexModifier = '';
|
||||
|
||||
// To prevent adding self-references, we now
|
||||
// extract the current page's title.
|
||||
@ -148,7 +150,7 @@
|
||||
// even indexes will point to text that is not enclosed by brackets
|
||||
$arr[$i] = preg_replace( '/(?<![\:\.\@\/\?\&])' .
|
||||
$wordStartDelim . '(' . $safeTitle . ')' .
|
||||
$wordEndDelim . '/i', '[[$1]]', $arr[$i], $limit, $count );
|
||||
$wordEndDelim . '/' . $regexModifier , '[[$1]]', $arr[$i], $limit, $count );
|
||||
if (( $limit >= 0 ) && ( $count > 0 )) {
|
||||
break;
|
||||
};
|
||||
|
@ -42,13 +42,14 @@
|
||||
$wgLinkTitlesFirstOnly = false;
|
||||
$wgLinkTitlesWordStartOnly = true;
|
||||
$wgLinkTitlesWordEndOnly = true;
|
||||
$wgLinkTitlesIgnoreCase = true;
|
||||
|
||||
$wgExtensionCredits['parserhook'][] = array(
|
||||
'path' => __FILE__,
|
||||
'name' => 'LinkTitles',
|
||||
'author' => '[http://www.mediawiki.org/wiki/User:Bovender Daniel Kraus]',
|
||||
'url' => 'http://www.mediawiki.org/wiki/Extension:LinkTitles',
|
||||
'version' => '1.6.1',
|
||||
'version' => '1.7.0',
|
||||
'descriptionmsg' => 'linktitles-desc'
|
||||
);
|
||||
|
||||
|
6
NEWS
6
NEWS
@ -1,3 +1,7 @@
|
||||
LinkTitles 1.7.0: 2013-01-22
|
||||
* Added new option to do exact searches of page titles; the default is to
|
||||
do __case-insensitive__ searches as before ($wgLinkTitlesIgnoreCase).
|
||||
|
||||
LinkTitles 1.6.1: 2012-12-31
|
||||
* Fixed a bug that caused linking to fail in certain situations when
|
||||
$wgLinkTitlesFirstOnly was set to true.
|
||||
@ -13,7 +17,7 @@ LinkTitles 1.4.0: 2012-10-09
|
||||
* Added new option to skip template variables.
|
||||
|
||||
LinkTitles 1.3.2: 2012-10-05
|
||||
* Fix incorrect handling of PreverShortTitles option.
|
||||
* Fix incorrect handling of PreferShortTitles option.
|
||||
|
||||
LinkTitles 1.3.1: 2012-10-05
|
||||
* Fix typo that prevented proper function of the extension.
|
||||
|
BIN
release/LinkTitles-1.8.0.tar.gz
Normal file
BIN
release/LinkTitles-1.8.0.tar.gz
Normal file
Binary file not shown.
Reference in New Issue
Block a user