Skip to content

Commit

Permalink
Support nested quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
Benoit Viguier authored and staabm committed May 16, 2024
1 parent d20f0bc commit adf903c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/QueryReflection/QueryReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ final class QueryReflection
// see https://github.com/php/php-src/blob/01b3fc03c30c6cb85038250bb5640be3a09c6a32/ext/pdo/pdo_sql_parser.re#L48
private const NAMED_PATTERN = ':[a-zA-Z0-9_]+';

private const REGEX_UNNAMED_PLACEHOLDER = '{(["\'])([^"\']*\1)|(' . self::UNNAMED_PATTERN . ')}';
private const REGEX_UNNAMED_PLACEHOLDER = '{(["\'])((?:(?!\1).)*\1)|(' . self::UNNAMED_PATTERN . ')}';

private const REGEX_NAMED_PLACEHOLDER = '{(["\'])([^"\']*\1)|(' . self::NAMED_PATTERN . ')}';
private const REGEX_NAMED_PLACEHOLDER = '{(["\'])((?:(?!\1).)*\1)|(' . self::NAMED_PATTERN . ')}';

/**
* @var QueryReflector|null
Expand Down

0 comments on commit adf903c

Please sign in to comment.