Skip to content

Commit

Permalink
Merge branch 'release/2.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Christensen authored and Jacob Christensen committed May 22, 2017
2 parents fd76a8b + 00d27f7 commit add017f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/TokenParser/SearchTokenParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,14 @@ public function parse(TokenStream $tokenStream)
$tokenStream->expect(Token::T_OPERATOR, 'search');
$tokenStream->expect(Token::T_OPEN_PARENTHESIS);
$searchTerm = $this->getParser()->getExpressionParser()->parseScalar($tokenStream);
if (!is_string($searchTerm)) {

// Only Strings or Integers
if (is_int($searchTerm) || is_float($searchTerm)) {
$searchTerm = (string) $searchTerm;
} elseif (!is_string($searchTerm)) {
throw new UnknownTokenException('RQL Search only allows strings');
}

$tokenStream->expect(Token::T_CLOSE_PARENTHESIS);

$searchNode = SearchNode::getInstance();
Expand Down

0 comments on commit add017f

Please sign in to comment.