Ticket #10372: wp-app.php.diff
| File wp-app.php.diff, 993 bytes (added by , 16 years ago) |
|---|
-
wp-app.php
780 780 } 781 781 782 782 $location = get_post_meta($entry['ID'], '_wp_attached_file', true); 783 $location = get_option ('upload_path') . '/' . $location; 783 784 $filetype = wp_check_filetype($location); 784 785 785 786 if(!isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext'])) … … 789 790 header('Content-Type: ' . $entry['post_mime_type']); 790 791 header('Connection: close'); 791 792 792 $fp = fopen($location, "rb"); 793 while(!feof($fp)) { 794 echo fread($fp, 4096); 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'); 795 805 } 796 fclose($fp);797 806 798 807 log_app('function',"get_file($postID)"); 799 808 exit;