Ignore:
Timestamp:
2011/02/20 12:03:00 (13 years ago)
Author:
kotani
Message:

#976 ([管理画面]プラグイン)

  • プラグインアップロード機能追加
  • リファクタリング開発
  • SC_CheckError 拡張子チェックメソッドFILE_EXT_CHECK() を、判定拡張子にピリオドが複数ある場合にも対応するよう修正
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/SC_CheckError.php

    r20090 r20246  
    621621            $errFlag = 1; 
    622622            $array_ext = explode(".", $_FILES[$value[1]]['name']); 
    623             $ext = $array_ext[ count ( $array_ext ) - 1 ]; 
    624             $ext = strtolower($ext); 
    625623 
    626624            $strExt = ""; 
    627625 
    628626            foreach ( $value[2] as $checkExt ){ 
     627                $ext = ""; 
     628 
     629                // チェック拡張子のピリオドの数を取得('tar.gz'の場合1個、'jpg'のように通常は0個) 
     630                $count_period = substr_count($checkExt, "."); 
     631                 
     632                if($count_period > 0) { 
     633                    for($i = max(array_keys($array_ext)) - $count_period; $i < count($array_ext); $i++) { 
     634                        $ext .= $array_ext[$i] . "."; 
     635                    } 
     636                    $ext = preg_replace("/.$/", "" ,$ext); 
     637                } else { 
     638                    $ext = $array_ext[ count ( $array_ext ) - 1 ]; 
     639                } 
     640 
     641                $ext = strtolower($ext); 
     642 
    629643                if ( $ext == $checkExt) { 
    630644                    $errFlag = 0; 
Note: See TracChangeset for help on using the changeset viewer.