Changeset 21926


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

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

Location:
branches/version-2_12-dev/data/class
Files:
10 edited

Legend:

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

    r21867 r21926  
    6464 
    6565        // PDFを読み込んでページ数を取得 
    66         $pageno = $this->setSourceFile($this->tpl_pdf); 
     66        $this->pageno = $this->setSourceFile($this->tpl_pdf); 
    6767    } 
    6868 
     
    8181        if (SC_Utils_Ex::sfIsInt($arrData['order_id'])) { 
    8282            $this->disp_mode = true; 
    83             $order_id = $arrData['order_id']; 
    8483        } 
    8584 
     
    141140 
    142141    function setOrderData() { 
     142        $arrOrder = array(); 
    143143        // DBから受注情報を読み込む 
    144144        $this->lfGetOrderData($this->arrData['order_id']); 
  • branches/version-2_12-dev/data/class/SC_Image.php

    r21867 r21926  
    8585 
    8686        //拡張子取得 
    87         if (!$ext) { 
    88             $array_ext = explode('.', $FromImgPath); 
    89             $ext = $array_ext[count($array_ext) - 1]; 
    90         } 
     87        $array_ext = explode('.', $FromImgPath); 
     88        $ext = $array_ext[count($array_ext) - 1]; 
    9189 
    9290        $MW = $ThmMaxWidth; 
  • branches/version-2_12-dev/data/class/SC_MobileEmoji.php

    r21867 r21926  
    5656        } 
    5757 
    58         static $arrMap; 
    59         if (!isset($arrMap)) { 
     58        static $arrMap = array(); 
     59        if (empty($arrMap)) { 
    6060            $arrMap = @include_once dirname(__FILE__) . "/../include/mobile_emoji_map_$carrier.inc"; 
    6161        } 
  • branches/version-2_12-dev/data/class/SC_MobileImage.php

    r21867 r21926  
    4848 
    4949            // HTML中のIMGタグを取得する 
     50            $images = array(); 
    5051            $pattern = '/<img\s+[^<>]*src=[\'"]?([^>"\'\s]+)[\'"]?[^>]*>/i'; 
    5152            $result = preg_match_all($pattern, $buffer, $images); 
  • branches/version-2_12-dev/data/class/SC_Product.php

    r21867 r21926  
    548548     */ 
    549549    function setPriceTaxTo($arrProducts) { 
    550         foreach ($arrProducts as $key => $val) { 
     550        foreach (array_keys($arrProducts) as $key) { 
    551551            $arrProducts[$key]['price01_min_format'] = number_format($arrProducts[$key]['price01_min']); 
    552552            $arrProducts[$key]['price01_max_format'] = number_format($arrProducts[$key]['price01_max']); 
     
    599599     */ 
    600600    function alldtlSQL($where_products_class = '') { 
    601         $where_clause = ''; 
    602601        if (!SC_Utils_Ex::isBlank($where_products_class)) { 
    603602            $where_products_class = 'AND (' . $where_products_class . ')'; 
  • branches/version-2_12-dev/data/class/SC_SelectSql.php

    r21867 r21926  
    122122    // checkboxなどで同一カラム内で単一、もしくは複数選択肢が有る場合 例: AND ( sex = xxx OR sex = xxx OR sex = xxx) AND ... 
    123123    function setItemTerm($arr, $ItemStr) { 
    124  
     124        $return = array(); 
    125125        foreach ($arr as $data) { 
    126126 
     
    147147    // NULL値が必要な場合 
    148148    function setItemTermWithNull($arr, $ItemStr) { 
    149  
    150         $item = " ${ItemStr} IS NULL "; 
     149        $return = array(); 
     150        $item = " {$ItemStr} IS NULL "; 
    151151 
    152152        if ($arr) { 
    153153            foreach ($arr as $data) { 
    154154                if ($data != '不明') { 
    155                     $item .= " OR ${ItemStr} = ?"; 
     155                    $item .= " OR {$ItemStr} = ?"; 
    156156                    $return[] = $data; 
    157157                } 
     
    159159        } 
    160160 
    161         $item = "(${item}) "; 
     161        $item = "({$item}) "; 
    162162        $this->setWhere($item); 
    163163        return $return; 
     
    165165    // NULLもしくは''で検索する場合 
    166166    function setItemTermWithNullAndSpace($arr, $ItemStr) { 
     167        $return = array(); 
    167168        $count = count($arr); 
    168         $item = " ${ItemStr} IS NULL OR ${ItemStr} = '' "; 
     169        $item = " {$ItemStr} IS NULL OR {$ItemStr} = '' "; 
    169170        $i = 1; 
    170171        if ($arr) { 
    171172            foreach ($arr as $data) { 
    172173                if ($i == $count) break; 
    173                 $item .= " OR ${ItemStr} = ?"; 
     174                $item .= " OR {$ItemStr} = ?"; 
    174175                $return[] = $data; 
    175176                $i ++; 
    176177            } 
    177178        } 
    178         $item = "(${item}) "; 
     179        $item = "({$item}) "; 
    179180        $this->setWhere($item); 
    180181        return $return; 
  • branches/version-2_12-dev/data/class/SC_SendMail.php

    r21867 r21926  
    200200    function getBaseHeader() { 
    201201        //-- 送信するメールの内容と送信先 
     202        $arrHeader = array(); 
    202203        $arrHeader['MIME-Version'] = '1.0'; 
    203204        $arrHeader['To'] = $this->to; 
  • 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    } 
  • branches/version-2_12-dev/data/class/SC_View.php

    r21867 r21926  
    7878 
    7979    // テンプレートの処理結果を取得 
    80     function fetch($template, $no_error=false) { 
     80    function fetch($template) { 
    8181        return $this->_smarty->fetch($template); 
    8282    } 
     
    192192    /* サイト初期設定 */ 
    193193    function initpath() { 
    194  
     194        $array = array(); 
    195195        $array['tpl_mainnavi'] = realpath(dirname(__FILE__)) . '/../Smarty/templates/frontparts/mainnavi.tpl'; 
    196196 
  • branches/version-2_12-dev/data/class/helper/SC_Helper_FPDI.php

    r21829 r21926  
    164164        // Data 
    165165        $fill = 0; 
     166        $h = 4; 
    166167        foreach ($data as $row) { 
    167168            $h = 4; 
Note: See TracChangeset for help on using the changeset viewer.