summaryrefslogtreecommitdiffstats
path: root/wp-app.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-06-25 10:29:11 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-06-25 10:29:11 +0000
commit6c1577513f4c4e89283047d4b10e43330037a613 (patch)
tree8e1346ee0f23ab6740187e0374ebfca245c5f86a /wp-app.php
parented919b2ff3b20db3703dc7f6735e994ed7b893da (diff)
downloadwordpress-mu-6c1577513f4c4e89283047d4b10e43330037a613.tar.gz
wordpress-mu-6c1577513f4c4e89283047d4b10e43330037a613.tar.xz
wordpress-mu-6c1577513f4c4e89283047d4b10e43330037a613.zip
Check post type after upload, thanks Alexander Concha
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1008 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-app.php')
-rw-r--r--wp-app.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/wp-app.php b/wp-app.php
index 078667d..aa1fff3 100644
--- a/wp-app.php
+++ b/wp-app.php
@@ -673,8 +673,9 @@ EOD;
}
$location = get_post_meta($entry['ID'], '_wp_attached_file', true);
+ $filetype = wp_check_filetype($location);
- if(!isset($location))
+ if(!isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext']))
$this->internal_error(__('Error ocurred while accessing post metadata for file location.'));
header('Content-Type: ' . $entry['post_mime_type']);
@@ -707,8 +708,9 @@ EOD;
}
$location = get_post_meta($entry['ID'], '_wp_attached_file', true);
+ $filetype = wp_check_filetype($location);
- if(!isset($location))
+ if(!isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext']))
$this->internal_error(__('Error ocurred while accessing post metadata for file location.'));
$fp = fopen("php://input", "rb");