diff options
| author | Savetheinternet <savetheinternet@n0v4.com> | 2010-11-05 20:32:40 +1100 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@n0v4.com> | 2010-11-05 20:32:40 +1100 |
| commit | f6abfa61c693b9b55937be0db0a54ca074349cc6 (patch) | |
| tree | bba3d754dfdd49b1f84338c9d5729f22ab6be385 /post.php | |
| parent | 6fc9db808747acf5a91caa65d65819d930f1b987 (diff) | |
Added a check to verify if .ZIP files are infact archives.
Diffstat (limited to 'post.php')
| -rw-r--r-- | post.php | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -121,6 +121,12 @@ if(!@move_uploaded_file($_FILES['file']['tmp_name'], $post['file'])) error(ERROR_NOMOVE);
if($post['zip']) {
+ // Validate ZIP file
+ if(is_resource($zip = zip_open($post['zip'])))
+ zip_close($zip);
+ else
+ error(ERR_INVALIDZIP);
+
$post['file'] = ZIP_IMAGE;
$post['extension'] = strtolower(substr($post['file'], strrpos($post['file'], '.') + 1));
}
@@ -191,7 +197,6 @@ if(in_array($extension, $allowed_ext)) {
if (zip_entry_open($zip, $entry, 'r')) {
-
// Fake post
$dump_post = Array(
'subject' => $post['subject'],
|
