Make WordPress Core

Changeset 5766


Ignore:
Timestamp:
06/26/2007 08:47:17 PM (17 years ago)
Author:
markjaquith
Message:

Check post type after upload. Props Alexander Concha

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/wp-app.php

    r5286 r5766  
    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.