mirror of
https://github.com/diocloid/LinkTitles.git
synced 2025-07-13 09:49:31 +02:00
Fix bug that could prevent linking when was set to true.
This commit is contained in:
@ -144,12 +144,14 @@
|
||||
$arr = preg_split( $delimiter, $text, -1, PREG_SPLIT_DELIM_CAPTURE );
|
||||
// dump( $arr );
|
||||
$safeTitle = str_replace( '/', '\/', $title );
|
||||
( $wgLinkTitlesFirstOnly ) ? $loopLimit = 1 : $loopLimit = count( $arr );
|
||||
for ( $i = 0; $i < $loopLimit; $i+=2 ) {
|
||||
for ( $i = 0; $i < count( $arr ); $i+=2 ) {
|
||||
// even indexes will point to text that is not enclosed by brackets
|
||||
$arr[$i] = preg_replace( '/(?<![\:\.\@\/\?\&])' .
|
||||
$wordStartDelim . '(' . $safeTitle . ')' .
|
||||
$wordEndDelim . '/i', '[[$1]]', $arr[$i], $limit );
|
||||
$wordEndDelim . '/i', '[[$1]]', $arr[$i], $limit, $count );
|
||||
if (( $limit >= 0 ) && ( $count > 0 )) {
|
||||
break;
|
||||
};
|
||||
};
|
||||
$text = implode( '', $arr );
|
||||
}; // if $title != $myTitle
|
||||
|
@ -48,7 +48,7 @@
|
||||
'name' => 'LinkTitles',
|
||||
'author' => '[http://www.mediawiki.org/wiki/User:Bovender Daniel Kraus]',
|
||||
'url' => 'http://www.mediawiki.org/wiki/Extension:LinkTitles',
|
||||
'version' => '1.6.0',
|
||||
'version' => '1.6.1',
|
||||
'descriptionmsg' => 'linktitles-desc'
|
||||
);
|
||||
|
||||
|
4
NEWS
4
NEWS
@ -1,3 +1,7 @@
|
||||
LinkTitles 1.6.1: 2012-12-31
|
||||
* Fixed a bug that caused linking to fail in certain situations when
|
||||
$wgLinkTitlesFirstOnly was set to true.
|
||||
|
||||
LinkTitles 1.6.0: 2012-12-22
|
||||
* Added new options to restrict linking to page titles at the beginning or an
|
||||
end of a word. This enables linking variants of a page title.
|
||||
|
BIN
release/LinkTitles-1.6.1.tar.gz
Normal file
BIN
release/LinkTitles-1.6.1.tar.gz
Normal file
Binary file not shown.
Reference in New Issue
Block a user