* Added support of piped wikilinks using double-width brackets
authorShinjiman <shinjiman@users.mediawiki.org>
Sat, 30 Aug 2008 13:33:05 +0000 (13:33 +0000)
committerShinjiman <shinjiman@users.mediawiki.org>
Sat, 30 Aug 2008 13:33:05 +0000 (13:33 +0000)
  patch by PhiLiP

RELEASE-NOTES
includes/parser/Parser.php

index cabd95c..af24a30 100644 (file)
@@ -102,6 +102,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 13471) Added NUMBERINGROUP magic word
 * (bug 11884) Now support Flash EXIF attribute
 * Show thumbnails in the file history list, patch by User:Agbad
+* Added support of piped wikilinks using double-width brackets
 
 === Bug fixes in 1.14 ===
 
index d17949a..032ecaa 100644 (file)
@@ -3714,11 +3714,13 @@ class Parser
                $nc = '[ _0-9A-Za-z\x80-\xff-]'; # Namespaces can use non-ascii!
 
                $p1 = "/\[\[(:?$nc+:|:|)($tc+?)( \\($tc+\\))\\|]]/";            # [[ns:page (context)|]]
+               $p4 = "/\[\[(:?$nc+:|:|)($tc+?)(($tc+))\\|]]/";             # [[ns:page(context)|]]
                $p3 = "/\[\[(:?$nc+:|:|)($tc+?)( \\($tc+\\)|)(, $tc+|)\\|]]/";  # [[ns:page (context), context|]]
                $p2 = "/\[\[\\|($tc+)]]/";                                      # [[|page]]
 
                # try $p1 first, to turn "[[A, B (C)|]]" into "[[A, B (C)|A, B]]"
                $text = preg_replace( $p1, '[[\\1\\2\\3|\\2]]', $text );
+               $text = preg_replace( $p4, '[[\\1\\2\\3|\\2]]', $text );
                $text = preg_replace( $p3, '[[\\1\\2\\3\\4|\\2]]', $text );
 
                $t = $this->mTitle->getText();