Skip to content

Commit 3d7522b

Browse files
committed
SqlBuilder: fixed compatiblity with PCRE2 used in PHP 7.3 [Closes #210]
related to PCRE bug https://bugs.exim.org/show_bug.cgi?id=2332
1 parent 19fca6f commit 3d7522b

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/Database/Table/SqlBuilder.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -604,12 +604,7 @@ protected function parseJoins(&$joins, &$query): void
604604
private function getColumnChainsRegxp(): string
605605
{
606606
return '~
607-
(?(DEFINE)
608-
(?P<word> [\w_]*[a-z][\w_]* )
609-
(?P<del> [.:] )
610-
(?P<node> (?&del)? (?&word) (\((?&word)\))? )
611-
)
612-
(?P<chain> (?!\.) ((?&node))*) \. (?P<column> (?&word) | \* )
607+
(?P<chain> (?!\.) (?: [.:]? (?>[\w_]*[a-z][\w_]*) (\([\w_]*[a-z][\w_]*\))? ) *) \. (?P<column> (?>[\w_]*[a-z][\w_]*) | \* )
613608
~xi';
614609
}
615610

@@ -622,10 +617,7 @@ public function parseJoinsCb(&$joins, $match): string
622617
}
623618

624619
preg_match_all('~
625-
(?(DEFINE)
626-
(?P<word> [\w_]*[a-z][\w_]* )
627-
)
628-
(?P<del> [.:])?(?P<key> (?&word))(\((?P<throughColumn> (?&word))\))?
620+
(?P<del> [.:])?(?P<key> [\w_]*[a-z][\w_]* )(\((?P<throughColumn> [\w_]*[a-z][\w_]* )\))?
629621
~xi', $chain, $keyMatches, PREG_SET_ORDER);
630622

631623
$parent = $this->tableName;

0 commit comments

Comments
 (0)