summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@n0v4.com>2011-01-02 22:45:25 +1100
committerSavetheinternet <savetheinternet@n0v4.com>2011-01-02 22:45:25 +1100
commite23aa7a7368f9c373f7593976ab84f8f093e5cbd (patch)
treee77e0bb9c6467c69d063670ff2fbaf32bd6b0ed0
parent90b48f128b84268e04d9dc795d9f9631ea188c20 (diff)
FILE_HASH in config.php
-rw-r--r--inc/config.php5
-rw-r--r--post.php3
2 files changed, 7 insertions, 1 deletions
diff --git a/inc/config.php b/inc/config.php
index 6824e71d..0347846c 100644
--- a/inc/config.php
+++ b/inc/config.php
@@ -87,6 +87,11 @@
// For resizing, max values
define('THUMB_WIDTH', 200, true);
define('THUMB_HEIGHT', 200, true);
+
+ // Store image hash in the database for r9k-like boards implementation soon
+ // Function name for hashing
+ // sha1_file, md5_file, etc.
+ define('FILE_HASH', 'md5_file', true);
// Maximum image upload size in bytes
define('MAX_FILESIZE', 10*1024*1024, true); // 10MB
diff --git a/post.php b/post.php
index 56bddd5d..169a55e1 100644
--- a/post.php
+++ b/post.php
@@ -166,7 +166,8 @@
error(ERR_MAXSIZE);
}
- $post['filehash'] = md5_file($post['file']);
+ $hash_function = FILE_HASH;
+ $post['filehash'] = $hash_function($post['file']);
$post['filesize'] = filesize($post['file']);
$image = createimage($post['extension'], $post['file']);