Mantis - Quercus
Viewing Issue Advanced Details
3829 major always 12-25-09 11:33 01-03-13 08:46
alexander_hristov  
nam  
normal  
closed 4.0.2  
fixed  
none    
none 4.0.34  
0003829: Regexp Failure
Drupal + DomainAccess has the following regexp in one of its functions:

$pattern = '{
  # Beginning of the string
  ^
  ((?P<anonymous_view>
    # Everything within this set of parentheses is named "anonymous view"
    (?:
      [^()]++ # anything not parentheses
    |
      \( (?P>anonymous_view) \) # an open parenthesis, more "anonymous view" and finally a close parenthesis.
    )*
  )[^()]+WHERE)
}x';

This regexp is subsequently used in preg_match($pattern, $query, $matches)

In this particular use case, query contains the string "SELECT DISTINCT(n.nid), n.sticky, n.created FROM {node} n WHERE n.promote = 1 AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC"

Under Quercus, preg_match fails with the following warning:
warning: com.caucho.quercus.lib.regexp.IllegalRegexpException: Expected '(?:P=name' or '(?:P (?:[^()]++|\( (?P>anonymous_view)\))*)[^()]+WHERE)/ [preg_match] in F:\glassfishv3\glassfish\domains\domain1\applications\planetalia\includes\database.inc on line 338.

Under PHP 5.3.1, works normally.

Notes
(0006138)
nam   
01-03-13 08:46   
php/4ed[0-2]

Fixed for 4.0.34.