Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002124 [Quercus] minor always 10-27-07 00:22 10-29-07 11:29
Reporter koreth View Status public  
Assigned To ferg
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 3.1.4 Product Version 3.1.3
  Product Build
Summary 0002124: Valid PHP regex not accepted by preg_replace()
Description <?php
print preg_replace('/([^{]*)({[^}]+})?/', '\1 \2 ', "def{ghi}jkl") . "\n";

Vanilla PHP prints "def {ghi} jkl". Quercus throws an exception.
Steps To Reproduce
Additional Information java.util.regex.PatternSyntaxException: Illegal repetition near index 7
([^{]*)({[^}]+})?
       ^
    at java.util.regex.Pattern.error(Pattern.java:1700)
    at java.util.regex.Pattern.closure(Pattern.java:2736)
    at java.util.regex.Pattern.sequence(Pattern.java:1876)
    at java.util.regex.Pattern.expr(Pattern.java:1739)
    at java.util.regex.Pattern.group0(Pattern.java:2491)
    at java.util.regex.Pattern.sequence(Pattern.java:1793)
    at java.util.regex.Pattern.expr(Pattern.java:1739)
    at java.util.regex.Pattern.compile(Pattern.java:1447)
    at java.util.regex.Pattern.<init>(Pattern.java:1130)
    at java.util.regex.Pattern.compile(Pattern.java:846)
    at com.caucho.quercus.lib.regexp.JavaRegexpModule.compileRegexp(JavaRegexpModule.java:1316)
    at com.caucho.quercus.lib.regexp.JavaRegexpModule.compileRegexp(JavaRegexpModule.java:1246)
    at com.caucho.quercus.lib.regexp.JavaRegexpModule.pregReplaceString(JavaRegexpModule.java:708)
    at com.caucho.quercus.lib.regexp.JavaRegexpModule.pregReplace(JavaRegexpModule.java:621)
    at com.caucho.quercus.lib.regexp.JavaRegexpModule.preg_replace(JavaRegexpModule.java:572)
    at com.caucho.quercus.lib.regexp.RegexpModule.preg_replace(RegexpModule.java:171)
    at sun.reflect.GeneratedMethodAccessor81.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:589)
    at com.caucho.quercus.module.StaticFunction.invoke(StaticFunction.java:120)
    at com.caucho.quercus.env.JavaInvoker.callMethod(JavaInvoker.java:604)
    at com.caucho.quercus.env.JavaInvoker.call(JavaInvoker.java:539)
    at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java:182)
    at com.caucho.quercus.expr.FunctionExpr.eval(FunctionExpr.java:126)
    at com.caucho.quercus.expr.AppendExpr.eval(AppendExpr.java:85)
    at com.caucho.quercus.env.JavaInvoker.evalArguments(JavaInvoker.java:415)
    at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java:170)
    at com.caucho.quercus.expr.FunctionExpr.eval(FunctionExpr.java:126)
    at com.caucho.quercus.program.ExprStatement.execute(ExprStatement.java:64)
    at com.caucho.quercus.program.QuercusProgram.execute(QuercusProgram.java:239)
    at com.caucho.quercus.page.InterpretedPage.execute(InterpretedPage.java:61)
    at com.caucho.quercus.page.QuercusPage.executeTop(QuercusPage.java:119)
    at com.caucho.quercus.servlet.ResinQuercusServlet.service(ResinQuercusServlet.java:146)
    at com.caucho.quercus.servlet.QuercusServlet.service(QuercusServlet.java:353)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:91)
    at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)
    at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:178)
    at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:241)
    at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:268)
    at com.caucho.server.port.TcpConnection.run(TcpConnection.java:591)
    at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:690)
    at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:612)
    at java.lang.Thread.run(Thread.java:637)
Attached Files

- Relationships

- Notes
(0002402)
ferg
10-29-07 11:29

php/1535

This looks like a snapshot a snapshot issue. 3.1.4 has a new regexp implementation which accepts full PHP regexps, but the snapshot reverted to the old implementation (JDK)

 

- Issue History
Date Modified Username Field Change
10-27-07 00:22 koreth New Issue
10-29-07 11:29 ferg Note Added: 0002402
10-29-07 11:29 ferg Assigned To  => ferg
10-29-07 11:29 ferg Status new => closed
10-29-07 11:29 ferg Resolution open => fixed
10-29-07 11:29 ferg Fixed in Version  => 3.1.4


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