Last modified: 2013-10-10 12:54:14 UTC
Created attachment 13461 [details] simple tag extension demonstrating the issue. When using $parser->recursiveTagParse($input), the & character is sometimes escaped and sometimes not: $input = 'a & b < a | b http://example.com?a&b'; $output = $parser->recursiveTagParse($input); Here, $output gets 'a & b < a | b <a rel="nofollow" class="external free" href="http://example.com?a&b">http://example.com?a&b">http://example.com?a&b</a>' The first & is not escaped, and the & in the URL is escaped. < and > are escaped. The source documentation of Parser::recursiveTagParse does not mention the expected behavior. However it should be either escaping the & characters or not. [As I have to parse the output of recursiveTagParse into a DOMDocument in my extension, this behavior makes my life real hard as I cannot just escape all & before parsing] I attached a mini-tag extension that can be used to further analyze the problem. Note that in a tag extension, all unescaped & in the returned string are converted to & by MediaWiki at a later stage so that correct HTML is returned even if someone would return the output of $parser->recursiveTagParse($some_wikitext) directly. This "hides" the bug but doesn't solve the underlying problem. Thanks for developing MediaWiki by the way. It's great! Philipp
(the comment function of buzilla destroyed the output line... Please take a look at the attached file - it's really short, I promise).