バージョン選択
フォーラム
メニュー
オンライン状況
|
|
29 人のユーザが現在オンラインです。 (15 人のユーザが フォーラム を参照しています。) |
|
|
バグ報告 > その他 > SC_CheckError::CHECK_DATE2メソッドのif文が恒等式になるバグ |
|
その他
投稿者 |
スレッド |
ゲスト |
投稿日時: 2013/6/4 19:49
対応状況: −−−
|
|
SC_CheckError::CHECK_DATE2メソッドのif文が恒等式になるバグ バグの報告です。CHECK_DATE2メソッドにおいて、
// 少なくともどれか一つが入力されている。 if ($this->arrParam[$value[1]] > 0 || $this->arrParam[$value[2]] > 0 || $this->arrParam[$value[3]] > 0 || $this->arrParam[$value[4]] >= 0 || $this->arrParam[$value[5]] >= 0) {
このif文の
$this->arrParam[$value[4]] >= 0 と $this->arrParam[$value[5]] >= 0 の式の値が常に成り立つ。
以下のように空文字が0と解釈されるため。
code: <?php if ('' >= 0) echo 'true';
echo "<br />"; echo (int)''; ?> result: true 0
以下の対応を行うとよい。 if ($this->arrParam[$value[1]] > 0 || $this->arrParam[$value[2]] > 0 || $this->arrParam[$value[3]] > 0 || ($this->arrParam[$value[4]] >= 0 && $this->arrParam[$value[4]] != '') || ($this->arrParam[$value[5]] >= 0 && $this->arrParam[$value[5]] != '')) {
php:5.2.17 eccube:2.12.4
|
|
|
|
統計情報
総メンバー数は89,514名です
総投稿数は110,112件です
|