From fd9443cf84cc529921377f40c71c361eb2f7ffdd Mon Sep 17 00:00:00 2001
From: Shish <webmaster@shishnet.org>
Date: Mon, 15 Dec 2008 14:55:04 -0800
Subject: [PATCH] human readable error when file too large

---
 ext/upload/main.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ext/upload/main.php b/ext/upload/main.php
index 4a9bc56a..d2afcb22 100644
--- a/ext/upload/main.php
+++ b/ext/upload/main.php
@@ -92,7 +92,9 @@ class Upload implements Extension {
 				$event->veto("Upload failed; disk nearly full");
 			}
 			if(filesize($event->tmpname) > $config->get_int('upload_size')) {
-				$event->veto("File too large (".filesize($event->tmpname)." &gt; ".($config->get_int('upload_size')).")");
+				$size = to_shorthand_int(filesize($event->tmpname));
+				$limit = to_shorthand_int($config->get_int('upload_size'));
+				$event->veto("File too large ($size &gt; $limit)");
 			}
 		}
 	}