Skip to content

Commit 388b172

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

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

Diff for: src/Database/Table/SqlBuilder.php

+2-10
Original file line numberDiff line numberDiff line change
@@ -667,12 +667,7 @@ protected function parseJoins(&$joins, &$query)
667667
private function getColumnChainsRegxp()
668668
{
669669
return '~
670-
(?(DEFINE)
671-
(?P<word> [\w_]*[a-z][\w_]* )
672-
(?P<del> [.:] )
673-
(?P<node> (?&del)? (?&word) (\((?&word)\))? )
674-
)
675-
(?P<chain> (?!\.) (?&node)*) \. (?P<column> (?&word) | \* )
670+
(?P<chain> (?!\.) (?: [.:]? (?>[\w_]*[a-z][\w_]*) (\([\w_]*[a-z][\w_]*\))? ) *) \. (?P<column> (?>[\w_]*[a-z][\w_]*) | \* )
676671
~xi';
677672
}
678673

@@ -688,10 +683,7 @@ public function parseJoinsCb(&$joins, $match)
688683
}
689684

690685
preg_match_all('~
691-
(?(DEFINE)
692-
(?P<word> [\w_]*[a-z][\w_]* )
693-
)
694-
(?P<del> [.:])?(?P<key> (?&word))(\((?P<throughColumn> (?&word))\))?
686+
(?P<del> [.:])?(?P<key> [\w_]*[a-z][\w_]* )(\((?P<throughColumn> [\w_]*[a-z][\w_]* )\))?
695687
~xi', $chain, $keyMatches, PREG_SET_ORDER);
696688

697689
$parent = $this->tableName;

0 commit comments

Comments
 (0)