PHP8 対応漏れ?「受注管理>受注登録」画面でシステムエラー
- Dominant language
- PHP
- Stars
- 92
- Forks
- 97
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 9
Description
[開発コミュニティ参照](https://xoops.ec-cube.net/modules/newbb/viewtopic.php?topic_id=28087&forum=9&post_id=111634#forumpost111634)
error.log
[/manager/order/edit.php] Fatal error(E_ERROR): Uncaught TypeError: Unsupported operand types: float + string in data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php:707
既存の受注情報を編集で、商品の単価を数字以外(例えば あ )を入力し、計算結果の確認ボタンを押すとシステムエラーで落ちます。(数量、税率、値引き、送料、手数料、使用ポイントも同様です。)
数字+文字ではWarninngこそ出ますが落ちません。また、PHP7.4では発生せず。
試しに、LC_Page_Admin_Order_Edit.php の lfCheckError() で
```
$emsg = false;
if ( isset($arrErrTemp['price']) || isset($arrErrTemp['quantity']) || isset($arrErrTemp['tax_rate']) || isset($arrErrTemp['discount']) || isset($arrErrTemp['deliv_fee']) || isset($arrErrTemp['charge']) || isset($arrErrTemp['use_point']) ) {
$emsg = true;
}
for ($i = 0; $i < $max; $i++) {
if($emsg){
$tax = 0;
$subtotal += 0;
$totaltax += 0;
$totalpoint += 0;
}
else{
// 小計の計算
$tax = SC_Helper_TaxRule_Ex::calcTax($arrValues['price'][$i], $arrValues['tax_rate'][$i], $arrValues['tax_rule'][$i]);
$subtotal += ($tax + $arrValues['price'][$i]) * $arrValues['quantity'][$i];
// 税額の計算
$totaltax += $tax * $arrValues['quantity'][$i];
// 加算ポイントの計算
$totalpoint += SC_Utils_Ex::sfPrePoint($arrValues['price'][$i], $arrValues['point_rate'][$i]) * $arrValues['quantity'][$i];
}
```
入力値(単価、数量、税率、値引き、送料、手数料、使用ポイント)のチェックでエラーが無い場合のみ現行の処理、
エラーがある場合は、計算に必要な数字を0として処理するよう処理として試してみましたが、
テンプレートedit.tpl:432 側で呼び出される
` 円
`
においても、Fatal error が発生します。
error.log
[/manager/order/edit.php] Fatal error(E_ERROR): Uncaught TypeError: Unsupported operand types: string * float in data/class/util\SC_Utils.php:711
となります。
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.