Ignore:
Timestamp:
2007/09/07 14:45:56 (17 years ago)
Author:
nanasess
Message:

未定義変数の修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update/data/class/SC_CheckError.php

    r15532 r15641  
    3737            return; 
    3838        } 
    39  
     39        $this->createParam($value); 
    4040        // 含まれているタグを抽出する 
    4141        preg_match_all("/<([\/]?[a-z]+)/", $this->arrParam[$value[1]], $arrTag); 
     
    6464            return; 
    6565        } 
     66        $this->createParam($value); 
    6667        if( strlen($this->arrParam[$value[1]]) == 0 ){ 
    6768            $this->arrErr[$value[1]] = "※ " . $value[0] . "が入力されていません。<br />"; 
     
    7576            return; 
    7677        } 
    77         if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = ""; 
     78        $this->createParam($value); 
    7879        if(strlen($this->arrParam[$value[1]]) != 0 && ereg("^[  \t\r\n]+$", $this->arrParam[$value[1]])){ 
    7980            $this->arrErr[$value[1]] = "※ " . $value[0] . "にスペース、タブ、改行のみの入力はできません。<br />"; 
     
    8788            return; 
    8889        } 
    89         if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = ""; 
     90        $this->createParam($value); 
    9091        if(strlen($this->arrParam[$value[1]]) != 0 && mb_ereg("[  \t\r\n]+", $this->arrParam[$value[1]])){ 
    9192            $this->arrErr[$value[1]] = "※ " . $value[0] . "にスペース、タブ、改行は含めないで下さい。<br />"; 
     
    9899            return; 
    99100        } 
    100         if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = ""; 
     101        $this->createParam($value); 
    101102        if(strlen($this->arrParam[$value[1]]) != 0 && ereg("^[0]+[0-9]+$", $this->arrParam[$value[1]])){ 
    102103            $this->arrErr[$value[1]] = "※ " . $value[0] . "に0で始まる数値が入力されています。<br />"; 
     
    110111            return; 
    111112        } 
    112         if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = ""; 
     113        $this->createParam($value); 
    113114        if( strlen($this->arrParam[$value[1]]) == 0 ){ 
    114115            $this->arrErr[$value[1]] = "※ " . $value[0] . "が選択されていません。<br />"; 
     
    122123            return; 
    123124        } 
    124         if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = ""; 
     125        $this->createParam($value); 
    125126        // 文字数の取得 
    126127        if( $this->arrParam[$value[2]] != $this->arrParam[$value[3]]) { 
     
    135136            return; 
    136137        } 
    137         if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = ""; 
     138        $this->createParam($value); 
    138139        // 文字数の取得 
    139140        if( $this->arrParam[$value[2]] == $this->arrParam[$value[3]]) { 
     
    148149            return; 
    149150        } 
    150         if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = ""; 
     151        $this->createParam($value); 
    151152        // 文字数の取得 
    152153        if($this->arrParam[$value[2]] != "" && $this->arrParam[$value[3]] != "" && ($this->arrParam[$value[2]] > $this->arrParam[$value[3]])) { 
     
    162163            return; 
    163164        } 
    164         if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = ""; 
     165        $this->createParam($value); 
    165166        // 文字数の取得 
    166167        if( mb_strlen($this->arrParam[$value[1]]) > $value[2] ) { 
     
    175176            return; 
    176177        } 
    177         if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = ""; 
     178        $this->createParam($value); 
    178179        // 文字数の取得 
    179180        if( mb_strlen($this->arrParam[$value[1]]) < $value[2] ) { 
     
    188189            return; 
    189190        } 
    190         if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = ""; 
     191        $this->createParam($value); 
    191192        // 文字数の取得 
    192193        if($this->arrParam[$value[1]] > $value[2] ) { 
     
    201202            return; 
    202203        } 
    203         if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = ""; 
     204        $this->createParam($value); 
    204205        if($this->arrParam[$value[1]] < $value[2] ) { 
    205206            $this->arrErr[$value[1]] = "※ " . $value[0] . "は" . $value[2] . "以上で入力してください。<br />"; 
     
    214215            return; 
    215216        } 
    216         if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = ""; 
     217        $this->createParam($value); 
    217218        if( strlen($this->arrParam[$value[1]]) > 0 && !EregI("^[[:digit:]]+$", $this->arrParam[$value[1]])) { 
    218219            $this->arrErr[$value[1]] = "※ " . $value[0] . "は数字で入力してください。<br />"; 
     
    226227            return; 
    227228        } 
    228         if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = ""; 
     229        $this->createParam($value); 
    229230        if( strlen($this->arrParam[$value[1]]) > 0 && !EregI("^[[:digit:]]+[\.]?[[:digit:]]+$", $this->arrParam[$value[1]])) { 
    230231            $this->arrErr[$value[1]] = "※ " . $value[0] . "は数字で入力してください。<br />"; 
     
    236237            return; 
    237238        } 
    238         if (!isset($this->arrParam[$value[1]])) $this->arrParam[$value[1]] = ""; 
     239        $this->createParam($value); 
    239240        if( strlen($this->arrParam[$value[1]]) > 0 && !EregI("^[[:alpha:]]+$", $this->arrParam[$value[1]])) { 
    240241            $this->arrErr[$value[1]] = "※ " . $value[0] . "は半角英字で入力してください。<br />"; 
     
    253254            return; 
    254255        } 
    255  
     256        $this->createParam($value); 
    256257        $cnt = 0; 
    257258 
     
    282283    function FULL_EXIST_CHECK($value) { 
    283284        $max = count($value); 
    284  
     285        $this->createParam($value); 
    285286        // 既に該当項目にエラーがある場合は、判定しない。 
    286287        for($i = 1; $i < $max; $i++) { 
     
    341342    function ONE_EXIST_CHECK($value) { 
    342343        $max = count($value); 
    343  
     344        $this->createParam($value); 
    344345        // 既に該当項目にエラーがある場合は、判定しない。 
    345346        for($i = 1; $i < $max; $i++) { 
     
    369370    function TOP_EXIST_CHECK($value) { 
    370371        $max = count($value); 
     372        $this->createParam($value); 
    371373 
    372374        // 既に該当項目にエラーがある場合は、判定しない。 
     
    403405            return; 
    404406        } 
     407        $this->createParam($value); 
    405408        if(strlen($this->arrParam[$value[1]]) > 0 && ! mb_ereg("^[ァ-ヶヲ-゚ー]+$", $this->arrParam[$value[1]])) { 
    406409            $this->arrErr[$value[1]] = "※ " . $value[0] . "はカタカナで入力してください。<br />"; 
     
    414417            return; 
    415418        } 
     419        $this->createParam($value); 
    416420        if(strlen($this->arrParam[$value[1]]) > 0 && ! mb_ereg("^([  \t\r\n]|[ァ-ヶ]|[ー])+$", $this->arrParam[$value[1]])) { 
    417421            $this->arrErr[$value[1]] = "※ " . $value[0] . "はカタカナで入力してください。<br />"; 
     
    425429            return; 
    426430        } 
     431        $this->createParam($value); 
    427432        if( strlen($this->arrParam[$value[1]]) > 0 && ! EregI("^[[:alnum:]]+$", $this->arrParam[$value[1]] ) ) { 
    428433            $this->arrErr[$value[1]] = "※ " . $value[0] . "は英数字で入力してください。<br />"; 
     
    433438    // value[0] = 項目名 value[1] = 判定対象 
    434439    function ZERO_CHECK( $value ) {             // 入力値で0が許されない場合エラーを返す 
    435  
     440        $this->createParam($value); 
    436441        if($this->arrParam[$value[1]] == "0" ){ 
    437442            $this->arrErr[$value[1]] = "※ " . $value[0] . "は1以上を入力してください。<br />"; 
     
    445450            return; 
    446451        } 
     452        $this->createParam($value); 
    447453        // $this->arrParam[$value[0]] = mb_convert_kana($this->arrParam[$value[0]], "n"); 
    448454        $count = strlen($this->arrParam[$value[1]]); 
     
    458464            return; 
    459465        } 
     466        $this->createParam($value); 
    460467        $count = strlen($this->arrParam[$value[1]]); 
    461468        if(($count > 0) && $count != $value[2] ) { 
     
    470477            return; 
    471478        } 
     479        $this->createParam($value); 
    472480        if(strlen($this->arrParam[$value[1]]) > 0 && !ereg("^[^@]+@[^.]+\..+", $this->arrParam[$value[1]])) { 
    473481            $this->arrErr[$value[1]] = "※ " . $value[0] . "の形式が不正です。<br />"; 
     
    481489            return; 
    482490        } 
     491        $this->createParam($value); 
    483492        if(strlen($this->arrParam[$value[1]]) > 0 && !ereg("^[a-zA-Z0-9_\.@\+\?-]+$",$this->arrParam[$value[1]]) ) { 
    484493            $this->arrErr[$value[1]] = "※ " . $value[0] . "に使用する文字を正しく入力してください。<br />"; 
     
    503512            return; 
    504513        } 
     514        $this->createParam($value); 
    505515 
    506516        if($_FILES[$value[1]]['name'] != "" ) { 
     
    536546        } 
    537547 
     548        $this->createParam($value); 
    538549        if($value[2] != "") { 
    539550            $dir = $value[2]; 
     
    556567            return; 
    557568        } 
     569        $this->createParam($value); 
    558570        if(!($_FILES[$value[1]]['size'] != "" && $_FILES[$value[1]]['size'] > 0)){ 
    559571            $this->arrErr[$value[1]] = "※ " . $value[0] . "をアップロードして下さい。<br />"; 
     
    567579            return; 
    568580        } 
     581        $this->createParam($value); 
    569582        if( $_FILES[$value[1]]['size'] > $value[2] *  1024 ){ 
    570583            $byte = "KB"; 
     
    583596            return; 
    584597        } 
     598        $this->createParam($value); 
    585599        if( strlen($_FILES[$value[1]]['name']) > 0 && ! EregI("^[[:alnum:]_\.-]+$", $_FILES[$value[1]]['name']) ) { 
    586600            $this->arrErr[$value[1]] = "※ " . $value[0] . "のファイル名に日本語やスペースは使用しないで下さい。<br />"; 
     
    594608            return; 
    595609        } 
    596  
     610        $this->createParam($value); 
    597611        if( strlen($this->arrParam[$value[1]]) > 0 && ! EregI("^[[:alnum:]_\.-]+$", $this->arrParam[$value[1]]) || EregI("[\\]" ,$this->arrParam[$value[1]])) { 
    598612            $this->arrErr[$value[1]] = "※ " . $value[0] . "のファイル名に日本語やスペースは使用しないで下さい。<br />"; 
     
    609623            return; 
    610624        } 
     625        $this->createParam($value); 
    611626        // 少なくともどれか一つが入力されている。 
    612627        if($this->arrParam[$value[1]] > 0 || $this->arrParam[$value[2]] > 0 || $this->arrParam[$value[3]] > 0) { 
     
    631646            return; 
    632647        } 
    633  
     648        $this->createParam($value); 
    634649        // 少なくともどれか一つが入力されている。 
    635650        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) { 
     
    651666            return; 
    652667        } 
    653  
     668        $this->createParam($value); 
    654669        // 少なくともどれか一つが入力されている。 
    655670        if($this->arrParam[$value[1]] > 0 || $this->arrParam[$value[2]] > 0) { 
     
    686701            return; 
    687702        } 
     703        $this->createParam($value); 
    688704        $error = 0; 
    689705        if ( (strlen($this->arrParam[$value[2]]) > 0 || strlen($this->arrParam[$value[3]]) > 0 || strlen($this->arrParam[$value[4]] ) > 0) && ! checkdate($this->arrParam[$value[3]], $this->arrParam[$value[4]], $this->arrParam[$value[2]]) ) { 
     
    736752            return; 
    737753        } 
     754        $this->createParam($value); 
    738755        $error = 0; 
    739756        if ( (strlen($this->arrParam[$value[2]]) > 0 || strlen($this->arrParam[$value[3]]) > 0 || strlen($this->arrParam[$value[4]] ) > 0 || strlen($this->arrParam[$value[5]]) > 0) && ! checkdate($this->arrParam[$value[3]], $this->arrParam[$value[4]], $this->arrParam[$value[2]]) ) { 
     
    779796            return; 
    780797        } 
     798        $this->createParam($value); 
    781799        $error = 0; 
    782800        if ( (strlen($this->arrParam[$value[2]]) > 0 || strlen($this->arrParam[$value[3]]) > 0) && ! checkdate($this->arrParam[$value[3]], 1, $this->arrParam[$value[2]]) ) { 
     
    802820            return; 
    803821        } 
     822        $this->createParam($value); 
    804823        if(!is_dir($this->arrParam[$value[1]])) { 
    805824            $this->arrErr[$value[1]] = "※ 指定した" . $value[0] . "は存在しません。<br />"; 
     
    823842            return; 
    824843        } 
     844        $this->createParam($value); 
    825845        if(strlen($this->arrParam[$value[1]]) > 0 && !gfIsMobileMailAddress($this->arrParam[$value[1]])) { 
    826846            $this->arrErr[$value[1]] = "※ " . $value[0] . "は携帯電話のものではありません。<br />"; 
     
    838858            return; 
    839859        } 
    840  
     860        $this->createParam($value); 
    841861        $targetStr     = $this->arrParam[$value[1]]; 
    842862        $prohibitedStr = str_replace(array('|', '/'), array('\|', '\/'), $value[2]); 
     
    847867        } 
    848868    } 
     869 
     870    /** 
     871     * 未定義の $this->arrParam に空要素を代入する. 
     872     * 
     873     * @access private 
     874     * @param array $value 配列 
     875     * @return void 
     876     */ 
     877    function createParam($value) { 
     878        foreach ($value as $key) { 
     879            if (!isset($this->arrParam[$key])) $this->arrParam[$key] = ""; 
     880        } 
     881    } 
    849882} 
    850883?> 
Note: See TracChangeset for help on using the changeset viewer.