バージョン選択

フォーラム

メニュー

オンライン状況

29 人のユーザが現在オンラインです。 (15 人のユーザが フォーラム を参照しています。)
登録ユーザ: 0
ゲスト: 29
もっと...

サイト内検索

バグ報告 > その他 > 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
フラット表示 前のトピック | 次のトピック


題名 投稿者 日時
 » SC_CheckError::CHECK_DATE2メソッドのif文が恒等式になるバグ ゲスト 2013/6/4 19:49
     Re: SC_CheckError::CHECK_DATE2メソッドのif文が恒等式になるバグ red 2013/6/4 20:36
       Re: SC_CheckError::CHECK_DATE2メソッドのif文が恒等式になるバグ seasoft 2013/6/4 22:58
       Re: SC_CheckError::CHECK_DATE2メソッドのif文が恒等式になるバグ ゲスト 2013/6/5 8:52
         Re: SC_CheckError::CHECK_DATE2メソッドのif文が恒等式になるバグ seasoft 2013/6/5 9:26

 



ログイン


EC-CUBE公式 Amazon Payプラグイン

統計情報

総メンバー数は89,514名です
総投稿数は110,112件です

投稿数ランキング

1
seasoft
7367
2
468
3217
3
AMUAMU
2712
4
nanasess
2314
5
umebius
2085
6
yuh
1819
7
h_tanaka
1656
8
red
1570
9
mcontact
1309
10
tsuji
958
11
fukap
907
12
shutta
835
13
tao_s
799
14 ramrun 789
15 karin 689
16 sumida 641
17
homan
633
18 DELIGHT 572
19
patapata
502
20
flealog
485


ネットショップの壺

EC-CUBEインテグレートパートナー

Copyright© EC-CUBE CO.,LTD. All Rights Reserved.