WordPress.org

Make WordPress Core

Changeset 5765


Ignore:
Timestamp:
06/26/2007 08:45:30 PM (11 years ago)
Author:
markjaquith
Message:

Check post type after upload. Props Alexander Concha

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-app.php

    r5760 r5765  
    674674
    675675        $location = get_post_meta($entry['ID'], '_wp_attached_file', true);
    676 
    677         if(!isset($location))
     676        $filetype = wp_check_filetype($location);
     677
     678        if(!isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext']))
    678679            $this->internal_error(__('Error ocurred while accessing post metadata for file location.'));
    679680
     
    708709
    709710        $location = get_post_meta($entry['ID'], '_wp_attached_file', true);
    710 
    711         if(!isset($location))
     711        $filetype = wp_check_filetype($location);
     712
     713        if(!isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext']))
    712714            $this->internal_error(__('Error ocurred while accessing post metadata for file location.'));
    713715
Note: See TracChangeset for help on using the changeset viewer.