summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@n0v4.com>2010-11-30 19:25:50 +1100
committerPaul Merrill <napalminc@gmail.com>2010-12-01 04:14:16 -0800
commitabb98de54371ffbb31819d18c5cec826298ad79d (patch)
treef6e8169d1b8c411aa8714bb8938a3d40caa1a4a7 /post.php
parent8107772cb722e144cbc8745ffd0fa0be8d65a644 (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