Make WordPress Core


Ignore:
Timestamp:
03/01/2010 10:45:11 PM (17 years ago)
Author:
nacin
Message:

Fall back to displaying mime type when file has no extension. fixes #9924 props mdawaffe

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-attachment-rows.php

    r13230 r13541  
    8686                ?>
    8787                <td <?php echo $attributes ?>><strong><?php if ( $is_trash ) echo $att_title; else { ?><a href="<?php echo get_edit_post_link( $post->ID, true ); ?>" title="<?php echo esc_attr(sprintf(__('Edit &#8220;%s&#8221;'), $att_title)); ?>"><?php echo $att_title; ?></a><?php } ?></strong><br />
    88                 <?php echo strtoupper(preg_replace('/^.*?\.(\w+)$/', '$1', get_attached_file($post->ID))); ?>
     88                <?php
     89                if ( preg_match( '/^.*?\.(\w+)$/', get_attached_file( $post->ID ), $matches ) )
     90                        echo wp_specialchars( strtoupper( $matches[1] ) );
     91                else
     92                        echo strtoupper( str_replace( 'image/', '', get_post_mime_type() ) );
     93                ?>
    8994                <p>
    9095                <?php
Note: See TracChangeset for help on using the changeset viewer.