Ignore:
Timestamp:
2012/06/19 18:01:38 (12 years ago)
Author:
pineray
Message:

#1669 #1859 初期化漏れ、無駄な変数等

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/SC_UploadFile.php

    r21894 r21926  
    218218    // 一時ファイルを保存ディレクトリに移す 
    219219    function moveTempFile() { 
    220         $cnt = 0; 
    221220        $objImage = new SC_Image_Ex($this->temp_dir); 
    222221 
    223         foreach ($this->keyname as $val) { 
     222        for ($cnt = 0; $cnt < count($this->keyname); $cnt++) { 
    224223            if (isset($this->temp_file[$cnt]) && $this->temp_file[$cnt] != '') { 
    225224 
     
    235234                } 
    236235            } 
    237             $cnt++; 
    238236        } 
    239237    } 
     
    241239    // ダウンロード一時ファイルを保存ディレクトリに移す 
    242240    function moveTempDownFile() { 
    243         $cnt = 0; 
    244241        $objImage = new SC_Image_Ex($this->temp_dir); 
    245         foreach ($this->keyname as $val) { 
     242        for ($cnt = 0; $cnt < count($this->keyname); $cnt++) { 
    246243            if (isset($this->temp_file[$cnt]) && $this->temp_file[$cnt] != '') { 
    247244                $objImage->moveTempImage($this->temp_file[$cnt], $this->save_dir); 
     
    254251                } 
    255252            } 
    256             $cnt++; 
    257253        } 
    258254    } 
     
    347343    function getFormDownFile() { 
    348344        $arrRet = ''; 
    349         $cnt = 0; 
    350         foreach ($this->keyname as $val) { 
     345        for ($cnt = 0; $cnt < count($this->keyname); $cnt++) { 
    351346            if (isset($this->temp_file[$cnt]) && $this->temp_file[$cnt] != '') { 
    352347                $arrRet = $this->temp_file[$cnt]; 
     
    354349                $arrRet = $this->save_file[$cnt]; 
    355350            } 
    356             $cnt++; 
    357351        } 
    358352        return $arrRet; 
     
    375369    function getDBFileList() { 
    376370        $cnt = 0; 
     371        $dbFileList = array(); 
    377372        foreach ($this->keyname as $val) { 
    378373            if (isset($this->temp_file[$cnt]) && $this->temp_file[$cnt] != '') { 
    379                 $arrRet[$val] = $this->temp_file[$cnt]; 
     374                $dbFileList[$val] = $this->temp_file[$cnt]; 
    380375            } else { 
    381                 $arrRet[$val] = isset($this->save_file[$cnt]) ? $this->save_file[$cnt] : ''; 
    382             } 
    383             $cnt++; 
    384         } 
    385         return $arrRet; 
     376                $dbFileList[$val] = isset($this->save_file[$cnt]) ? $this->save_file[$cnt] : ''; 
     377            } 
     378            $cnt++; 
     379        } 
     380        return $dbFileList; 
    386381    } 
    387382 
     
    405400 
    406401    // DBで保存されたダウンロードファイル名をセットする(setDBDownFileと統合予定) 
    407     function setPostFileList($arrPost,$arrVal) { 
    408         $cnt = 0; 
    409         foreach ($this->keyname as $val) { 
     402    function setPostFileList($arrPost) { 
     403        for ($cnt = 0;$cnt < count($this->keyname); $cnt++) { 
    410404            if (isset($arrPost['temp_down_realfilename:' . ($cnt+1)])) { 
    411405                $this->temp_file[$cnt] = $arrPost['temp_down_realfilename:' . ($cnt+1)]; 
    412406            } 
    413             $cnt++; 
    414407        } 
    415408    } 
Note: See TracChangeset for help on using the changeset viewer.