Ticket #853 (closed バグ指摘: 修正済)

Opened 10 years ago

Last modified 9 years ago

SC_FormParam#getSwapArray 歯抜けを正しく処理できない

Reported by: Seasoft Owned by: Seasoft
Priority: Milestone: EC-CUBE2.11.2
Component: その他 Version: 2.3.4
Keywords: Cc:
修正済み: yes

Description (last modified by Seasoft) (diff)

配列に歯抜けが無い前提となっている。歯抜けがあると、後方のデータが欠落する。

    function getSwapArray($arrKey) {
        foreach($arrKey as $keyname) {
            $arrVal = $this->getValue($keyname);
            $max = count($arrVal);
            for($i = 0; $i < $max; $i++) {
                $arrRet[$i][$keyname] = $arrVal[$i];
            }
        }
        return $arrRet;
    }

改訂案

    function getSwapArray($arrKey) {
        $arrRet = array();
        foreach($arrKey as $keyname) {
            $arrVal = (array)$this->getValue($keyname);
            foreach ($arrVal as $index => $val) {
                $arrRet[$index][$keyname] = $val;
            }
        }
        return $arrRet;
    }
  • 従来は歯抜けの要素に NULL がセットされていたのが、未定義となるため、この事による現実装への影響が読みきれていない。

r20943 r20949 r21134

Change History

comment:1 Changed 10 years ago by Seasoft

  • Description modified (diff)

comment:2 Changed 10 years ago by nanasess

  • Milestone changed from EC-CUBE2.5.0beta to EC-CUBE2.5.1(仮)

comment:3 Changed 10 years ago by kajiwara

  • 修正済み unset
  • Milestone changed from EC-CUBE2.11.1 to EC-CUBE2.11.2

引き続きの対応とします。

comment:4 Changed 10 years ago by Seasoft

  • Owner changed from somebody to Seasoft
  • 修正済み set
  • Status changed from new to assigned
  • Description modified (diff)

2.11.1 にて具体的な不具合が発生したため、改修しました。

comment:5 Changed 9 years ago by kajiwara

  • Status changed from assigned to closed
  • Resolution set to 修正済

Seasoftさん

ソース確認しました。

ありがとうございました。

comment:6 Changed 9 years ago by Seasoft

  • Description modified (diff)

comment:7 Changed 9 years ago by Seasoft

  • Description modified (diff)
Note: See TracTickets for help on using tickets.