diff --git a/LinkTitles.body.php b/LinkTitles.body.php index 7f71c0c..1c3ecfc 100755 --- a/LinkTitles.body.php +++ b/LinkTitles.body.php @@ -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( '/(?= 0 ) && ( $count > 0 )) { + break; + }; }; $text = implode( '', $arr ); }; // if $title != $myTitle diff --git a/LinkTitles.php b/LinkTitles.php index fcd27ef..78b3cf3 100755 --- a/LinkTitles.php +++ b/LinkTitles.php @@ -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' ); diff --git a/NEWS b/NEWS index ea63a00..21d55da 100644 --- a/NEWS +++ b/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. diff --git a/release/LinkTitles-1.6.1.tar.gz b/release/LinkTitles-1.6.1.tar.gz new file mode 100644 index 0000000..3554b4d Binary files /dev/null and b/release/LinkTitles-1.6.1.tar.gz differ