Fix counting actual new links.

- Fix: Many pages would not be linked.
This commit is contained in:
Daniel Kraus
2017-09-23 07:16:28 +02:00
parent f5c1605fe7
commit 7c1563e82a

View File

@ -113,7 +113,8 @@ class Linker {
for ( $i = 0; $i < count( $arr ); $i += 2 ) { for ( $i = 0; $i < count( $arr ); $i += 2 ) {
$arr[$i] = preg_replace_callback( $target->getCaseSensitiveRegex(), $arr[$i] = preg_replace_callback( $target->getCaseSensitiveRegex(),
array( $this, 'simpleModeCallback'), array( $this, 'simpleModeCallback'),
$arr[$i], $limit, $count ); $arr[$i], $limit, $replacements );
$count += $replacements;
if ( $this->config->firstOnly && ( $count > 0 ) ) { if ( $this->config->firstOnly && ( $count > 0 ) ) {
$limitReached = true; $limitReached = true;
break; break;
@ -137,7 +138,8 @@ class Linker {
// even indexes will point to text that is not enclosed by brackets // even indexes will point to text that is not enclosed by brackets
$arr[$i] = preg_replace_callback( $target->getCaseInsensitiveRegex(), $arr[$i] = preg_replace_callback( $target->getCaseInsensitiveRegex(),
array( $this, 'smartModeCallback'), array( $this, 'smartModeCallback'),
$arr[$i], $limit, $count ); $arr[$i], $limit, $replacements );
$count += $replacements;
if ( $this->config->firstOnly && ( $count > 0 )) { if ( $this->config->firstOnly && ( $count > 0 )) {
break; break;
}; };