Changeset 1008

Show
Ignore:
Timestamp:
06/25/07 10:29:11 (1 year ago)
Author:
donncha
Message:

Check post type after upload, thanks Alexander Concha

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-app.php

    r972 r1008  
    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