Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001673 [Quercus] minor always 04-06-07 20:44 04-11-07 05:14
Reporter snb View Status public  
Assigned To nam
Priority normal Resolution fixed  
Status closed   Product Version 3.1.1
Summary 0001673: Quercus preg_split() result differs from PHP's when using PREG_SPLIT_DELIM_CAPTURE
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.
Additional Information
Attached Files  preg_split_bug.php [^] (419 bytes) 04-06-07 20:44

- Relationships

- Notes
(0001833)
nam
04-11-07 05:14

php/152r
php/152s
 

- Issue History
Date Modified Username Field Change
04-06-07 20:44 snb New Issue
04-06-07 20:44 snb File Added: preg_split_bug.php
04-06-07 20:45 snb Issue Monitored: snb
04-11-07 05:14 nam Status new => assigned
04-11-07 05:14 nam Assigned To  => nam
04-11-07 05:14 nam Status assigned => closed
04-11-07 05:14 nam Note Added: 0001833
04-11-07 05:14 nam Resolution open => fixed
04-11-07 05:14 nam Fixed in Version  => 3.1.1


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
31 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker