Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-app.php

    r11811 r11416  
    781781
    782782        $location = get_post_meta($entry['ID'], '_wp_attached_file', true);
    783         $location = get_option ('upload_path') . '/' . $location;
    784783        $filetype = wp_check_filetype($location);
    785784
     
    791790        header('Connection: close');
    792791
    793         if ($fp = fopen($location, "rb")) {
    794             status_header('200');
    795             header('Content-Type: ' . $entry['post_mime_type']);
    796             header('Connection: close');
    797 
    798             while(!feof($fp)) {
    799                 echo fread($fp, 4096);
    800             }
    801 
    802             fclose($fp);
    803         } else {
    804             status_header ('404');
    805         }
     792        $fp = fopen($location, "rb");
     793        while(!feof($fp)) {
     794            echo fread($fp, 4096);
     795        }
     796        fclose($fp);
    806797
    807798        log_app('function',"get_file($postID)");
Note: See TracChangeset for help on using the changeset viewer.