diff --git a/src/ORM/Queries/SQLConditionalExpression.php b/src/ORM/Queries/SQLConditionalExpression.php index 03cc57758..d128124b5 100644 --- a/src/ORM/Queries/SQLConditionalExpression.php +++ b/src/ORM/Queries/SQLConditionalExpression.php @@ -802,6 +802,6 @@ abstract class SQLConditionalExpression extends SQLExpression */ 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 000000000..b3cb4eaef --- /dev/null +++ b/tests/php/ORM/DBQueryBuilderTest.php @@ -0,0 +1,27 @@ +assertSame('FROM SomeTable ' . $join, trim($builder->buildFromFragment($select, $params))); + } +}