From abb98de54371ffbb31819d18c5cec826298ad79d Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Tue, 30 Nov 2010 19:25:50 +1100 Subject: [PATCH] Minor bug with posts not containing files --- post.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/post.php b/post.php index 4458164c..ca8132ba 100644 --- a/post.php +++ b/post.php @@ -188,8 +188,10 @@ } // Remove DIR_* before inserting them into the database. - $post['file'] = substr_replace($post['file'], '', 0, strlen(DIR_IMG)); - $post['thumb'] = substr_replace($post['thumb'], '', 0, strlen(DIR_THUMB)); + if($post['has_file']) { + $post['file'] = substr_replace($post['file'], '', 0, strlen(DIR_IMG)); + $post['thumb'] = substr_replace($post['thumb'], '', 0, strlen(DIR_THUMB)); + } // Todo: Validate some more, remove messy code, allow more specific configuration