Mantis - Quercus
|
|||||||||||||||
Viewing Issue Advanced Details | |||||||||||||||
|
|||||||||||||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: | ||||||||||
1562 | major | always | 01-17-07 03:40 | 06-25-07 12:45 | |||||||||||
|
|||||||||||||||
Reporter: | obaltz | Platform: | |||||||||||||
Assigned To: | sam | OS: | |||||||||||||
Priority: | normal | OS Version: | |||||||||||||
Status: | closed | Product Version: | 3.1.0 | ||||||||||||
Product Build: | Resolution: | fixed | |||||||||||||
Projection: | none | ||||||||||||||
ETA: | none | Fixed in Version: | 3.1.2 | ||||||||||||
|
|||||||||||||||
Summary: | 0001562: Problem with back references to subpatterns in preg_match_all | ||||||||||||||
Description: |
When using a back reference within the pattern, the behaviour of preg_match_all differs from the original php implementation. The PEAR template engine (class HTML_Template_IT) doesn't work due to this bug. See Additional info for a demo script. The pattern used in the script is the same as used in the PEAR class. The demo script contains the same pattern twice, firstly as a single-quoted, secondly as a double-quoted string. The original php implementation treats those differently, Quercus does not. Quercus always behaves as if it were double-quoted. |
||||||||||||||
Steps To Reproduce: | |||||||||||||||
Additional Information: |
Demo script: <?php $pattern = '@<!--\s+BEGIN\s+([0-9A-Za-z_-]+)\s+-->(.*)<!--\s+END\s+\1\s+-->@sm'; // this will work with original php interpreter ONLY // $pattern = "@<!--\s+BEGIN\s+([0-9A-Za-z_-]+)\s+-->(.*)<!--\s+END\s+\1\s+-->@sm"; // this will never work $string = "pre block <!-- BEGIN testblock --> inside block <!-- END testblock --> post block"; $regs = array(); $result = preg_match_all( $pattern, $string, $regs, PREG_SET_ORDER ); var_dump( $result ); var_dump( $regs ); ?> The original php interpreter outputs: int(1) array(1) { [0]=> array(3) { [0]=> string(60) "<!-- BEGIN testblock --> inside block <!-- END testblock -->" [1]=> string(9) "testblock" [2]=> string(14) " inside block " } } Quercus outputs: int(0) array(0) { } |
||||||||||||||
Relationships |
| ||||||||||||||
Attached Files: |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|