Skip to content

Division by 0 #886

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

Closed
taophp opened this issue Sep 12, 2016 · 0 comments
Closed

Division by 0 #886

taophp opened this issue Sep 12, 2016 · 0 comments

Comments

@taophp
Copy link

taophp commented Sep 12, 2016

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.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

taophp pushed a commit to taophp/PHPWord that referenced this issue Sep 12, 2016
@troosan troosan closed this as completed Dec 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants