From 7c1563e82accc6e34a445a7bf2a615cef0f2fe05 Mon Sep 17 00:00:00 2001 From: Daniel Kraus Date: Sat, 23 Sep 2017 07:16:28 +0200 Subject: [PATCH] Fix counting actual new links. - Fix: Many pages would not be linked. --- includes/Linker.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/Linker.php b/includes/Linker.php index 04871dc..62b07af 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -113,7 +113,8 @@ class Linker { for ( $i = 0; $i < count( $arr ); $i += 2 ) { $arr[$i] = preg_replace_callback( $target->getCaseSensitiveRegex(), array( $this, 'simpleModeCallback'), - $arr[$i], $limit, $count ); + $arr[$i], $limit, $replacements ); + $count += $replacements; if ( $this->config->firstOnly && ( $count > 0 ) ) { $limitReached = true; break; @@ -137,7 +138,8 @@ class Linker { // even indexes will point to text that is not enclosed by brackets $arr[$i] = preg_replace_callback( $target->getCaseInsensitiveRegex(), array( $this, 'smartModeCallback'), - $arr[$i], $limit, $count ); + $arr[$i], $limit, $replacements ); + $count += $replacements; if ( $this->config->firstOnly && ( $count > 0 )) { break; };