You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just import a docx and tried to export it to odt using PHPWord. At some point, I get this error: PHP Warning: Division by zero in .../vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Style/Paragraph.php on line 40.
I investigated so the fact is that the document had a paragraph style where the getSpaceBefore method return the string "0", instead of NULL as expected. Indeed, this document is still valid for any text processor I tested, so it must be also for PHPWord.
I think the code could be improved using PHP transtyping feature to solve this issue. Simply replace is_null by ==0.
I just import a docx and tried to export it to odt using PHPWord. At some point, I get this error:
PHP Warning: Division by zero in .../vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Style/Paragraph.php on line 40
.I investigated so the fact is that the document had a paragraph style where the
getSpaceBefore
method return the string"0"
, instead ofNULL
as expected. Indeed, this document is still valid for any text processor I tested, so it must be also for PHPWord.I think the code could be improved using PHP transtyping feature to solve this issue. Simply replace
is_null
by==0
.Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: