Ticket #9233: wp-app.php.diff
| File wp-app.php.diff, 1.2 KB (added by josephscott, 4 years ago) |
|---|
-
wp-app.php
26 26 /** Feed Handling API */ 27 27 require_once(ABSPATH . WPINC . '/feed.php'); 28 28 29 /** Image updates */ 30 require_once(ABSPATH . '/wp-admin/includes/image.php'); 31 29 32 $_SERVER['PATH_INFO'] = preg_replace( '/.*\/wp-app\.php/', '', $_SERVER['REQUEST_URI'] ); 30 33 31 34 /** … … 814 817 $this->auth_required(__('Sorry, you do not have the right to edit this post.')); 815 818 } 816 819 820 $upload_dir = wp_upload_dir( ); 817 821 $location = get_post_meta($entry['ID'], '_wp_attached_file', true); 818 822 $filetype = wp_check_filetype($location); 819 823 824 $location = "{$upload_dir['basedir']}/{$location}"; 825 820 826 if(!isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext'])) 821 827 $this->internal_error(__('Error ocurred while accessing post metadata for file location.')); 822 828 … … 843 849 $this->internal_error(__('Sorry, your entry could not be posted. Something wrong happened.')); 844 850 } 845 851 852 wp_update_attachment_metadata( $postID, wp_generate_attachment_metadata( $postID, $location ) ); 853 846 854 log_app('function',"put_file($postID)"); 847 855 $this->ok(); 848 856 }
