Test wiki link to title with question mark
authorGabriel Wicke <gwicke@wikimedia.org>
Wed, 21 Nov 2012 01:36:33 +0000 (17:36 -0800)
committerGabriel Wicke <gwicke@wikimedia.org>
Wed, 21 Nov 2012 01:36:52 +0000 (17:36 -0800)
Percent-encode the question mark so that it is not treated as a query string
separator.

Change-Id: I8b3402df96fb783954cf6d7cd0fdffcf104bbe99

tests/parser/parserTests.txt

index 2d8a6b8..f6091b4 100644 (file)
@@ -102,6 +102,12 @@ Template:table_attribs
 |</noinclude>style="color: red"| Foo
 !! endarticle
 
+!! article
+A?b
+!! text
+Weirdo titles!
+!! endarticle
+
 ###
 ### Basic tests
 ###
@@ -3149,6 +3155,18 @@ Plain link to protocol-relative URL with link text
 </p>
 !! end
 
+!! test
+Plain link to page with question mark in title
+!! input
+[[A?b]]
+
+[[A?b|Baz]]
+!! result
+<p><a href="/wiki/A%3Fb" title="A?b">A?b</a>
+</p><p><a href="/wiki/A%3Fb" title="A?b">Baz</a>
+</p>
+!! end
+
 
 # I'm fairly sure the expected result here is wrong.
 # We want these to be URL links, not pseudo-pages with URLs for titles....