enjoping / DXFighter

A new DXF writer and reader in PHP which outputs AC1012 (R15) DXF files
BSD 3-Clause "New" or "Revised" License
42 stars 22 forks source link

unhandled exception on specific DXF file #22

Closed elerocks closed 2 years ago

elerocks commented 2 years ago

Problem Trying to read attached file will cause

Undefined array key 39 at /project/vendor/enjoping/dxfighter/DXFighter.php

(github does not allow uploading dxf files, so the uploaded file is regular dxf with manually changed extension to svg)

3D_20220420_100953

Solution change $thickness = $data[39] ? $data[39] : 0; to $thickness = isset($data[39]) ? $data[39] : 0;

Additional details Tested on PHP 8.1

elerocks commented 2 years ago

I've just noticed it is duplicate of https://github.com/enjoping/DXFighter/issues/18 , so closing this one