mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
Clean query visitor text merging
This commit is contained in:
@@ -167,11 +167,9 @@ class QueryVisitor implements Visit
|
|||||||
$root = new AST\TextNode($root->getValue(), $node);
|
$root = new AST\TextNode($root->getValue(), $node);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// Merge text nodes together, but not with quoted ones
|
// Merge text nodes together (quoted nodes do not)
|
||||||
if ($root instanceof AST\TextNode &&
|
if ($root instanceof AST\TextNode &&
|
||||||
$node instanceof AST\TextNode &&
|
$node instanceof AST\TextNode) {
|
||||||
!$root instanceof AST\QuotedTextNode &&
|
|
||||||
!$node instanceof AST\QuotedTextNode) {
|
|
||||||
// Prevent merge once a context is set
|
// Prevent merge once a context is set
|
||||||
if ($root->hasContext()) {
|
if ($root->hasContext()) {
|
||||||
throw new \Exception('Unexpected text node after context');
|
throw new \Exception('Unexpected text node after context');
|
||||||
|
Reference in New Issue
Block a user