From: Brian Wolff Date: Mon, 23 Jun 2014 20:45:41 +0000 (-0300) Subject: Allow fragments in link= parameter in tags. X-Git-Tag: 1.31.0-rc.0~15270^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/categories/modifier.php?a=commitdiff_plain;h=d7d8458bc0c0ffd2b93fcda35810809e83c1a26d;p=lhc%2Fweb%2Fwiklou.git Allow fragments in link= parameter in tags. This brings the image syntax in gallery tags inline with normal syntax. Handle File:foo.png|link=bar#baz properly. Bug: 62343 Change-Id: If6149ccc19f70605ad4481e4da2ca55676d6001d --- diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 236b999eb3..61fd9cc2dd 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -5339,7 +5339,7 @@ class Parser { } else { $localLinkTitle = Title::newFromText( $linkValue ); if ( $localLinkTitle !== null ) { - $link = $localLinkTitle->getLocalURL(); + $link = $localLinkTitle->getLinkURL(); } } break; diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index c447a44c53..b3e9c511fd 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -15134,6 +15134,37 @@ image:foobar.jpg|Blabla|alt=This is a foo-bar.|blabla. !! end +!! test +Gallery with link that has fragment +!! wikitext + +image:foobar.jpg|link=Main_Page +image:foobar.jpg|link=Main_Page#section +image:foobar.jpg|link=Main Page#section|caption + +!! html + + +!! end + !! test Gallery with wikitext inside caption !! wikitext