Ticket #10372: wp-app.patch
| File wp-app.patch, 1.1 KB (added by , 16 years ago) |
|---|
-
wp-app.php
785 785 if(!isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext'])) 786 786 $this->internal_error(__('Error ocurred while accessing post metadata for file location.')); 787 787 788 status_header('200'); 789 header('Content-Type: ' . $entry['post_mime_type']); 790 header('Connection: close'); 788 $location = get_option ('upload_path') . '/' . $location; 789 if ($fp = fopen($location, "rb")) { 790 status_header('200'); 791 header('Content-Type: ' . $entry['post_mime_type']); 792 header('Connection: close'); 791 793 792 $fp = fopen($location, "rb"); 793 while(!feof($fp)) { 794 echo fread($fp, 4096); 795 } 796 fclose($fp); 794 while(!feof($fp)) { 795 echo fread($fp, 4096); 796 } 797 fclose($fp); 798 } 799 else { 800 status_header ('404'); 801 } 797 802 798 803 log_app('function',"get_file($postID)"); 799 804 exit;