summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
authorPaul Merrill <napalminc@gmail.com>2010-11-02 08:59:25 -0700
committerPaul Merrill <napalminc@gmail.com>2010-11-02 08:59:25 -0700
commit1f1417373f7358b31f102072392c5c7a7a16f2e8 (patch)
tree86014816e1e6a105dc3984548d8ba5e1b7bc60e6 /post.php
parent18e41db86785ddee31e9515233e3f3f25a3051f7 (diff)
Handle uppercase file extensions.
Diffstat (limited to 'post.php')
-rw-r--r--post.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/post.php b/post.php
index c8b51df2..4aceefd9 100644
--- a/post.php
+++ b/post.php
@@ -27,7 +27,9 @@
$post['thread'] = round($_POST['thread']);
} else $OP = true;
- if(!(($OP && $_POST['post'] == BUTTON_NEWTOPIC) || (!$OP && $_POST['post'] == BUTTON_REPLY))) error(ERROR_BOT);
+ if(!(($OP && $_POST['post'] == BUTTON_NEWTOPIC) ||
+ (!$OP && $_POST['post'] == BUTTON_REPLY)))
+ error(ERROR_BOT);
// Check the referrer
if($OP) {
@@ -49,7 +51,8 @@
// Check for a file
if($OP) {
- if(!isset($_FILES['file']['tmp_name']) || empty($_FILES['file']['tmp_name'])) error(ERROR_NOIMAGE);
+ if(!isset($_FILES['file']['tmp_name']) || empty($_FILES['file']['tmp_name']))
+ error(ERROR_NOIMAGE);
}
$post['name'] = (!empty($_POST['name'])?$_POST['name']:'Anonymous');
@@ -70,7 +73,7 @@
} else $noko = false;
if($post['has_file']) {
- $post['extension'] = substr($post['filename'], strrpos($post['filename'], '.') + 1);
+ $post['extension'] = strtolower(substr($post['filename'], strrpos($post['filename'], '.') + 1));
$post['file_id'] = rand(0, 1000000000);
$post['file'] = DIR_IMG . $post['file_id'] . '.' . $post['extension'];
$post['thumb'] = DIR_THUMB . $post['file_id'] . '.png';