Make WordPress Core

Changeset 12581


Ignore:
Timestamp:
12/30/2009 07:59:33 AM (14 years ago)
Author:
azaozz
Message:

Add more document file type extensions, props Otto42, dd32, hakre, fixes #7225

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r12580 r12581  
    22372237 */
    22382238function wp_ext2type( $ext ) {
    2239     $ext2type = apply_filters('ext2type', array(
    2240         'audio' => array('aac','ac3','aif','aiff','mp1','mp2','mp3','m3a','m4a','m4b','ogg','ram','wav','wma'),
    2241         'video' => array('asf','avi','divx','dv','mov','mpg','mpeg','mp4','mpv','ogm','qt','rm','vob','wmv', 'm4v'),
    2242         'document' => array('doc','docx','pages','odt','rtf','pdf'),
    2243         'spreadsheet' => array('xls','xlsx','numbers','ods'),
    2244         'interactive' => array('ppt','pptx','key','odp','swf'),
    2245         'text' => array('txt'),
    2246         'archive' => array('tar','bz2','gz','cab','dmg','rar','sea','sit','sqx','zip'),
    2247         'code' => array('css','html','php','js'),
     2239    $ext2type = apply_filters( 'ext2type', array(
     2240        'audio'       => array( 'aac', 'ac3',  'aif',  'aiff', 'm3a',  'm4a',   'm4b', 'mka', 'mp1',  'mp2', 'mp3', 'ogg', 'ram', 'wav', 'wma' ),
     2241        'video'       => array( 'asf', 'avi',  'divx', 'dv',   'flv',  'mkv',   'mov', 'mpg', 'mpeg', 'mp4', 'mpv', 'ogm', 'qt',  'rm', 'vob', 'wmv', 'm4v' ),
     2242        'document'    => array( 'doc', 'docx', 'docm', 'dotm', 'odt',  'pages', 'pdf', 'rtf' ),
     2243        'spreadsheet' => array( 'numbers',     'ods',  'xls',  'xlsx', 'xlsb',  'xlsm' ),
     2244        'interactive' => array( 'key', 'ppt',  'pptx', 'pptm', 'odp',  'swf' ),
     2245        'text'        => array( 'asc', 'txt' ),
     2246        'archive'     => array( 'bz2', 'cab',  'dmg',  'gz',   'rar',  'sea',   'sit', 'sqx', 'tar', 'tgz', 'zip' ),
     2247        'code'        => array( 'css', 'html', 'php',  'js' ),
    22482248    ));
    22492249    foreach ( $ext2type as $type => $exts )
    2250         if ( in_array($ext, $exts) )
     2250        if ( in_array( $ext, $exts ) )
    22512251            return $type;
    22522252}
     
    23062306        'mov|qt' => 'video/quicktime',
    23072307        'mpeg|mpg|mpe' => 'video/mpeg',
    2308         'txt|c|cc|h' => 'text/plain',
     2308        'txt|asc|c|cc|h' => 'text/plain',
    23092309        'rtx' => 'text/richtext',
    23102310        'css' => 'text/css',
     
    23172317        'mid|midi' => 'audio/midi',
    23182318        'wma' => 'audio/wma',
     2319        'mka' => 'audio/x-matroska',
     2320        'mkv' => 'video/x-matroska',
    23192321        'rtf' => 'application/rtf',
    23202322        'js' => 'application/javascript',
    23212323        'pdf' => 'application/pdf',
    23222324        'doc|docx' => 'application/msword',
    2323         'pot|pps|ppt|pptx' => 'application/vnd.ms-powerpoint',
     2325        'pot|pps|ppt|pptx|ppam|pptm|sldm|ppsm|potm' => 'application/vnd.ms-powerpoint',
    23242326        'wri' => 'application/vnd.ms-write',
    2325         'xla|xls|xlsx|xlt|xlw' => 'application/vnd.ms-excel',
     2327        'xla|xls|xlsx|xlt|xlw|xlam|xlsb|xlsm|xltm' => 'application/vnd.ms-excel',
    23262328        'mdb' => 'application/vnd.ms-access',
    23272329        'mpp' => 'application/vnd.ms-project',
     2330        'docm|dotm' => 'application/vnd.ms-word',
     2331        'pptx|sldx|ppsx|potx' => 'application/vnd.openxmlformats-officedocument.presentationml',
     2332        'xlsx|xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml',
     2333        'docx|dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml',
     2334        'onetoc|onetoc2|onetmp|onepkg' => 'application/onenote',
    23282335        'swf' => 'application/x-shockwave-flash',
    23292336        'class' => 'application/java',
Note: See TracChangeset for help on using the changeset viewer.