Description |
preg_split() in Quercus when using PREG_SPLIT_DELIM_CAPTURE will return an array containing all parenthesized delimiters along with the split up text. PHP does the same thing with a subtle difference: if one or more of the parenthesized delimiters comes after a | and earlier delimiters match, the latter delimiters will be ignored. This is a lot easier to demonstrate with an example. The attached PHP script will display the following when run with the Quercus snapshot from 070402:
Array ( [0] => This is a string with a nowiki tag: ''' [1] => nowiki [2] => [3] => >
[4] => [5] => [[blah blah]]''' )
Array ( [0] => Here's something with an html comment: [1] => [2] => [3] => [4] => !--
[5] => this is a comment --> )
Using PHP 5.2.1 however, the following is displayed:
Array ( [0] => This is a string with a nowiki tag: ''' [1] => nowiki [2] => [3] => >
[4] => [[blah blah]]''' )
Array ( [0] => Here's something with an html comment: [1] => [2] => [3] => [4] => !--
[5] => this is a comment --> )
The string containing a comment is parsed the same on both, but the one containing a "nowiki" tag contains the text tag at index 5 under Quercus, but 4 under PHP. I think Quercus' preg_split() does the right thing, but unfortunately includes/Parser.php in MediaWiki 1.9.3 depends on PHP's wacky implementation of preg_split(). So, when running under Quercus, MediaWiki cannot properly handle nowiki or pre tags currently. |