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

納品書PDF出力のメディアボックスがサイズ0になる問題を修正 #476

Merged
merged 1 commit into from
Oct 15, 2021

Conversation

kaorukobo
Copy link
Contributor

問題

こちらのテストの通り、FPDFのコンストラクタが呼ばれていないため、FPDFでゼロ除算が発生。
結果として、不正なPDF(/MediaBoxがサイズゼロ)が出力される。

修正

FPDFのコンストラクタを呼ぶようにしました。

補足

PHPUnitに慣れていないため、もしテストのより適切な書き方があればご変更・ご指示ください。

@codecov-commenter
Copy link

Codecov Report

Merging #476 (ecf806b) into master (0d0f7a2) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #476      +/-   ##
============================================
- Coverage     46.50%   46.49%   -0.01%     
  Complexity       14       14              
============================================
  Files            81       81              
  Lines         10572    10573       +1     
============================================
  Hits           4916     4916              
- Misses         5656     5657       +1     
Flag Coverage Δ
tests 46.49% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
data/class/SC_Fpdf.php 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0d0f7a2...ecf806b. Read the comment docs.

Copy link
Contributor

@nanasess nanasess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

確認遅れました。問題なさそうです。ありがとうございます!

@nanasess
Copy link
Contributor

PHPStan と Windows 環境でのエラーは本PRには関係なさそうですので別PRで対応します

@nanasess
Copy link
Contributor

PHPStan のエラーについては #447 で対応しました

@nanasess
Copy link
Contributor

Windows 環境のエラーについては #478 で対応しました

@matsuoshi matsuoshi merged commit 5c9e390 into EC-CUBE:master Oct 15, 2021
@kaorukobo kaorukobo deleted the fix-fpdf-yield-invalid-mediabox branch October 15, 2021 08:24
@nanasess nanasess added this to the 2.17.2 milestone Oct 17, 2021
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.

4 participants