diff --git a/src/ORM/Queries/SQLConditionalExpression.php b/src/ORM/Queries/SQLConditionalExpression.php index 03cc577582a..d128124b5fb 100644 --- a/src/ORM/Queries/SQLConditionalExpression.php +++ b/src/ORM/Queries/SQLConditionalExpression.php @@ -802,6 +802,6 @@ public function toUpdate() */ public static function getJoinRegex(): string { - return '/JOIN +.*? +(AS|ON|USING\(?) +/i'; + return '/JOIN\s+.*?\s+(AS|ON|USING\(?)\s+/is'; } } diff --git a/tests/php/ORM/DBQueryBuilderTest.php b/tests/php/ORM/DBQueryBuilderTest.php new file mode 100644 index 00000000000..b3cb4eaef67 --- /dev/null +++ b/tests/php/ORM/DBQueryBuilderTest.php @@ -0,0 +1,27 @@ +assertSame('FROM SomeTable ' . $join, trim($builder->buildFromFragment($select, $params))); + } +}