summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@n0v4.com>2010-11-30 19:25:50 +1100
committerSavetheinternet <savetheinternet@n0v4.com>2010-11-30 19:25:50 +1100
commitf4ccafe1db765703c00ba7859836903247b6a4a7 (patch)
tree81f81dda155fae45cf7232b3540d3b7febba9d8c /post.php
parentc3178f7ab468afbe478ad0415b75ed3914f2742c (diff)
Minor bug with posts not containing files
Diffstat (limited to 'post.php')
-rw-r--r--post.php6
1 files 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