Fixed what seems to be an off-by-one error (it tried to access one past the end of...
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 8 Mar 2004 02:46:27 +0000 (02:46 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 8 Mar 2004 02:46:27 +0000 (02:46 +0000)
includes/Tokenizer.php

index 1556dd4..e563a7c 100644 (file)
@@ -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"] = "[[";