From ddacf874df2d8c9bc25cd48b75e060fc95f9da62 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 8 Mar 2004 02:46:27 +0000 Subject: [PATCH] Fixed what seems to be an off-by-one error (it tried to access one past the end of the array quite consistently). Someone who understands this code, please check. --- includes/Tokenizer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/Tokenizer.php b/includes/Tokenizer.php index 1556dd4799..e563a7c8e5 100644 --- a/includes/Tokenizer.php +++ b/includes/Tokenizer.php @@ -64,7 +64,7 @@ class Tokenizer { function previewToken() { - if ( $this->mMatchPos <= $this->mCount ) { + if ( $this->mMatchPos < $this->mCount ) { $token["pos"] = $this->mPos; if ( $this->mPos < $this->mMatch[0][$this->mMatchPos][1] ) { $token["type"] = "text"; @@ -76,7 +76,7 @@ class Tokenizer { } else { # If linkPrefixExtension is set, $this->mMatch[2][$this->mMatchPos][0] # contains the link prefix, or is null if no link prefix exist. - if ( $this->mMatch[2][$this->mMatchPos][0] ) + if ( isset( $this->mMatch[2] ) && $this->mMatch[2][$this->mMatchPos][0] ) { # prefixed link open tag, [0] is "prefix[[" $token["type"] = "[["; -- 2.20.1