Make named capture groups compatible with older PCRE versions.

CentOS is terrible and generally contains very old versions of PCRE.
Update patterns to use more backwards compatible named capture groups.

Fixes #3821
This commit is contained in:
mark_story 2013-05-09 12:18:26 -04:00
parent de5b25e352
commit b533c1b3ba

View file

@ -170,7 +170,7 @@ class Hash {
*/
protected static function _matches(array $data, $selector) {
preg_match_all(
'/(\[ (?<attr>[^=><!]+?) (\s* (?<op>[><!]?[=]|[><]) \s* (?<val>(?:\/.*?\/ | [^\]]+)) )? \])/x',
'/(\[ (?P<attr>[^=><!]+?) (\s* (?P<op>[><!]?[=]|[><]) \s* (?P<val>(?:\/.*?\/ | [^\]]+)) )? \])/x',
$selector,
$conditions,
PREG_SET_ORDER