From ec8f064efc6e697cf206b0ed5e8d2d96cf190957 Mon Sep 17 00:00:00 2001 From: Shinjiman Date: Sat, 30 Aug 2008 13:33:05 +0000 Subject: [PATCH] * Added support of piped wikilinks using double-width brackets patch by PhiLiP --- RELEASE-NOTES | 1 + includes/parser/Parser.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index cabd95cd6e..af24a30b6d 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index d17949a0e6..032ecaa850 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -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(); -- 2.20.1