use wfRegexReplacement() which was added a little while ago to cover this silly regex...
authorBrion Vibber <brion@users.mediawiki.org>
Thu, 19 Jan 2006 06:29:41 +0000 (06:29 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Thu, 19 Jan 2006 06:29:41 +0000 (06:29 +0000)
includes/Linker.php

index 9ac52a2..ab96209 100644 (file)
@@ -732,9 +732,7 @@ class Linker {
                                        $match[1] = substr($match[1], 1);
                                $thelink = $this->makeLink( $match[1], $text, "", $trail );
                        }
-                       # Quote backreferences, then run preg_replace
-                       $thelink = strtr( $thelink, array( "\\" => "\\\\", '$' => "\\$" ) );
-                       $comment = preg_replace( $linkRegexp, $thelink, $comment, 1 );
+                       $comment = preg_replace( $linkRegexp, wfRegexReplacement( $thelink ), $comment, 1 );
                }
                wfProfileOut( $fname );
                return $comment;