Skip to content

Conversation

@MPolleke
Copy link

Hi, loading a PGN with castling move with a NAG results in a hard crash on PHP 8.0.2. This PR should fix that.

PHP Error:
Fatal error: Uncaught Error: Unsupported operand types: string + int
in chessParser/FenParser0x88.php on line 1253

Sample code:

$pgn = '[Event "chessParser test"] [Site "test: Castling with NAG"] [Date "2021.02.16"] [Round "1"] [White "White player"] [Black "Black player"] [Result "*"] [PlyCount "12"] 1. e4 e5 2. d3 d6 3. Nc3 Nc6 4. Bd2 Bd7 5. Qe2 Qe7 6. O-O-O O-O-O= *';
$pgnparser = new PgnParser();
$pgnparser->setPgnContent($pgn);
$game = $pgnparser->getFirstGame();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant