Ignore:
Timestamp:
2009/09/01 12:31:58 (17 years ago)
Author:
Seasoft
Message:

SC_Utils#sfIsInt の改修。

  • 「0」をINT型でないと見なしてしまうバグを修正。
  • 他の問題点をコメントに記述。
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/data/class/util/SC_Utils.php

    r18259 r18273  
    261261    } 
    262262 
    263     // INT型の数値チェック 
     263    /** 
     264     *  INT型の数値チェック 
     265     *  ・FIXME: マイナス値の扱いが不明確 
     266     *  ・XXX: INT_LENには収まるが、INT型の範囲を超えるケースに対応できないのでは? 
     267     *   
     268     *  @param mixed $value 
     269     *  @return bool 
     270     */ 
     271    //  
    264272    function sfIsInt($value) { 
    265         if($value != "" && strlen($value) <= INT_LEN && is_numeric($value)) { 
     273        if (strlen($value) >= 1 && strlen($value) <= INT_LEN && is_numeric($value)) { 
    266274            return true; 
    267275        } 
Note: See TracChangeset for help on using the changeset viewer.