From: Shinjiman Date: Sat, 30 Aug 2008 13:33:05 +0000 (+0000) Subject: * Added support of piped wikilinks using double-width brackets X-Git-Tag: 1.31.0-rc.0~45548 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=ec8f064efc6e697cf206b0ed5e8d2d96cf190957;p=lhc%2Fweb%2Fwiklou.git * Added support of piped wikilinks using double-width brackets patch by PhiLiP --- 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();