From 01bbe8fca7e50327c54faa26e41a1fdd57156762 Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Mon, 3 Jan 2011 01:41:14 +1100 Subject: [PATCH] Optimize code when checking if locked. --- post.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/post.php b/post.php index f76b2c73..d2306ca1 100644 --- a/post.php +++ b/post.php @@ -101,10 +101,9 @@ // Check if thread is locked // but allow mods to post - if(!$OP && threadLocked($post['thread'])) { - if(!$mod || $mod['type'] < MOD_POSTINLOCKED) { + if(!$OP && (!$mod || $mod['type'] < MOD_POSTINLOCKED)) { + if(threadLocked($post['thread'])) error(ERROR_LOCKED); - } } if($post['has_file']) {