summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
authorPaul Merrill <napalminc@gmail.com>2010-11-04 04:30:23 -0700
committerPaul Merrill <napalminc@gmail.com>2010-11-04 04:30:23 -0700
commit455f0c2602350f229e6f58d624790c3d7448a68b (patch)
tree9dcc84e33f757846e37ae896c829e433bed2d4d7 /post.php
parent2eddc7a4ee2a48ca6197c4dba2f8f563a81354aa (diff)
Improved large file size error message.
Diffstat (limited to 'post.php')
-rw-r--r--post.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/post.php b/post.php
index 94b80f8c..52048be8 100644
--- a/post.php
+++ b/post.php
@@ -74,8 +74,13 @@
$post['filename'] = $_FILES['file']['name'];
$post['has_file'] = $OP || !empty($_FILES['file']['tmp_name']);
- if($post['has_file'] && $_FILES['file']['size'] > MAX_FILESIZE)
- error(ERR_FILSIZE);
+ if($post['has_file']) {
+ $size = $_FILES['file']['size'];
+ if($size > MAX_FILESIZE)
+ error(sprintf3(ERR_FILESIZE, array(
+ 'filesz'=>commaize($size),
+ 'maxsz'=>commaize(MAX_FILESIZE))));
+ }
$trip = generate_tripcode($post['name']);
$post['name'] = $trip[0];