From b879fd409d0b0451762e1ba9fa85724c4954e171 Mon Sep 17 00:00:00 2001 From: Daniel Kraus Date: Sun, 3 Sep 2017 09:33:38 +0200 Subject: [PATCH] Fix regex for existing link detection. - Fix: Detection of existing links had a bug. --- includes/Linker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/Linker.php b/includes/Linker.php index 0065896..d875339 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -94,7 +94,7 @@ class Linker { // A link to the current page should only be recognized if it appears in // clear text, i.e. we do not count piped links as existing links. // (Similarly, by design, redirections should not be counted as existing links.) - if ( $limit == 1 && preg_match( '/[[' . $target->getCaseSensitiveLinkValueRegex() . ']]/' , $source->getText() ) ) { + if ( $limit == 1 && preg_match( '/\[\[' . $target->getCaseSensitiveLinkValueRegex() . ']]/' , $source->getText() ) ) { continue; }