Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support castling move with NAG in FenParser. #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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.

None yet

1 participant