From 8a0930c582de99d972deec33cb9cd91d1b02a15b Mon Sep 17 00:00:00 2001 From: programarivm Date: Mon, 23 Sep 2024 11:22:28 +0200 Subject: [PATCH] Filter the movetext for further processing --- src/Command/Data/SearchCommand.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Command/Data/SearchCommand.php b/src/Command/Data/SearchCommand.php index 4dd47c1..b0fc2d9 100644 --- a/src/Command/Data/SearchCommand.php +++ b/src/Command/Data/SearchCommand.php @@ -2,6 +2,8 @@ namespace ChessServer\Command\Data; +use Chess\Movetext\SanMovetext; +use Chess\Variant\Classical\PGN\Move; use ChessServer\Db; use ChessServer\Command\AbstractCommand; use ChessServer\Socket\AbstractSocket; @@ -50,7 +52,8 @@ public function run(AbstractSocket $socket, array $argv, int $id) if (in_array($key, self::SQL_LIKE)) { $sql .= "$key LIKE :$key AND "; if ($key === 'movetext') { - $val = $params['movetext']; + $val = (new SanMovetext(new Move(), $params['movetext'])) + ->filtered($comments = true, $nags = false); } $values[] = [ 'param' => ":$key",