From 29d2d6ab96b3147546c46068ef17613f2e3c927c Mon Sep 17 00:00:00 2001 From: tslocum Date: Fri, 7 Jan 2011 01:50:03 -0800 Subject: [PATCH] minor code cleanup --- .htaccess | 4 ++-- README.md | 2 +- imgboard.php | 4 +--- inc/functions.php | 6 ++++++ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.htaccess b/.htaccess index 1e573a2..66ed0e0 100644 --- a/.htaccess +++ b/.htaccess @@ -21,8 +21,8 @@ ExpiresByType image/png "access plus 2592000 seconds" ExpiresByType text/css "access plus 604800 seconds" ExpiresByType text/javascript "access plus 216000 seconds" ExpiresByType application/x-javascript "access plus 216000 seconds" - + AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript - + diff --git a/README.md b/README.md index e77d08c..544e5ce 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Installing 1. CD to the directory you wish to install TinyIB 2. Run the following command: - `git clone git://github.com/tslocum/TinyIB.git ./` - 3. Rename settings.default.php to settings.php + 3. Copy settings.default.php to settings.php 4. Configure settings.php 5. CHMOD write permissions to the following directories: - / diff --git a/imgboard.php b/imgboard.php index 99e9231..cf233d6 100644 --- a/imgboard.php +++ b/imgboard.php @@ -57,10 +57,8 @@ if (isset($_POST["message"]) || isset($_POST["file"])) { $modpost = isModPost(); if (!$loggedin) { checkBanned(); + checkMessageSize(); checkFlood(); - if (strlen($_POST["message"]) > 8000) { - fancyDie("Please shorten your message, or post it in multiple parts. Your message is " . strlen($_POST["message"]) . " characters long, and the maximum allowed is 8000."); - } } $post = newPost(); diff --git a/inc/functions.php b/inc/functions.php index d599089..cd2ec61 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -197,6 +197,12 @@ function checkFlood() { } } +function checkMessageSize() { + if (strlen($_POST["message"]) > 8000) { + fancyDie("Please shorten your message, or post it in multiple parts. Your message is " . strlen($_POST["message"]) . " characters long, and the maximum allowed is 8000."); + } +} + function manageCheckLogIn() { $loggedin = false; $isadmin = false; if (isset($_POST['password'])) {