Ignore:
Timestamp:
2012/01/17 16:21:07 (12 years ago)
Author:
Seasoft
Message:

2.12系へマイルストーン変更となったチケット分を差し戻し
r21357 #1324
r21356 #1324,#1565
r21355 #1431
r21354 #1555
r21353 #1563
r21352 #1431
r21351 #1538
r21350 #1560

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_11-dev/data/class/helper/SC_Helper_Mobile.php

    r21402 r21405  
    3434 */ 
    3535class SC_Helper_Mobile { 
    36  
    37     /** 基本MimeType */ 
    38     var $defaultMimeType = 'application/force-download'; 
    39  
    40     /** 拡張MimeType配列 
    41      * Application/octet-streamで対応出来ないファイルタイプのみ拡張子をキーに記述する 
    42      * 拡張子が本配列に存在しない場合は application/force-download を利用する */ 
    43     var $arrMimetypes = array( 
    44             'html'=> 'text/html', 
    45             'css' => 'text/css', 
    46             'hdml'=> 'text/x-hdml', 
    47             'mmf' => 'application/x-smaf', 
    48             'jpeg'=> 'image/jpeg', 
    49             'jpg' => 'image/jpeg', 
    50             'gif' => 'image/gif', 
    51             'png' => 'image/png', 
    52             'bmp' => 'image/x-ms-bmp', 
    53             'amc' => 'application/x-mpeg', 
    54             '3g2' => 'video/3gpp2', 
    55             '3gp' => 'video/3gpp', 
    56             'jam' => 'application/x-jam', 
    57             'kjx' => 'application/x-kjx', 
    58             'jar' => 'application/java-archive', 
    59             'jad' => 'text/vnd.sun.j2me.app-descriptor', 
    60             'swf' => 'application/x-shockwave-flash', 
    61             'dmt' => 'application/x-decomail-template', 
    62             'khm' => 'application/x-kddi-htmlmail', 
    63             'hmt' => 'application/x-htmlmail-template', 
    64             'ucm' => 'application/x-ucf-package', 
    65             'ucp' => 'application/x-ucf-package', 
    66             'pdf' => 'application/pdf', 
    67             'wma' => 'audio/x-ms-wma', 
    68             'asf' => 'video/x-ms-asf', 
    69             'wax' => 'audio/x-ms-wax', 
    70             'wvx' => 'video/x-ms-wvx', 
    71             'wmv' => 'video/x-ms-wmv', 
    72             'asx' => 'video/asx', 
    73             'txt' => 'text/plain', 
    74             'exe' => 'application/octet-stream', 
    75             'zip' => 'application/zip', 
    76             'doc' => 'application/msword', 
    77             'xls' => 'application/vnd.ms-excel', 
    78             'ppt' => 'application/vnd.ms-powerpoint' 
    79         ); 
    8036 
    8137    /** 
     
    282238        ob_start(array('SC_MobileImage_Ex', 'handler')); 
    283239 
    284         //download.phpに対してカタカナ変換をするとファイルが壊れてしまうため回避する 
    285         if ($_SERVER['SCRIPT_FILENAME'] != HTML_REALDIR . "mypage/download.php") { 
    286             // 全角カタカナを半角カタカナに変換する。 
    287             ob_start(create_function('$buffer', 'return mb_convert_kana($buffer, "k", "SJIS-win");')); 
    288         } 
     240        // 全角カタカナを半角カタカナに変換する。 
     241        ob_start(create_function('$buffer', 'return mb_convert_kana($buffer, "k", "SJIS-win");')); 
    289242 
    290243        // 内部エンコーディングから Shift JIS に変換する。 
     
    507460        return false; 
    508461    } 
    509  
    510     /** 
    511      * ファイルのMIMEタイプを判別する 
    512      * 
    513      * @param string $filename ファイル名 
    514      * @return string MIMEタイプ 
    515      */ 
    516     function getMimeType($filename) { 
    517         //ファイルの拡張子からコンテンツタイプを決定する 
    518         $file_extension = strtolower(substr(strrchr($filename,"."),1)); 
    519         $mime_type = $this->defaultMimeType; 
    520         if(array_key_exists($file_extension, $this->arrMimetypes)){ 
    521             $mime_type = $this->arrMimetypes[$file_extension]; 
    522         } 
    523         return $mime_type; 
    524     } 
    525462} 
    526463?> 
Note: See TracChangeset for help on using the changeset viewer.