summaryrefslogtreecommitdiff
path: root/inc/functions.php
diff options
context:
space:
mode:
authorMichael Save <savetheinternet@tinyboard.org>2012-04-09 20:46:57 +1000
committerMichael Save <savetheinternet@tinyboard.org>2012-04-09 20:46:57 +1000
commit69c9a9dd452299e0e8f7335966a1d0b4036df583 (patch)
treecfaa2aa5e9ea21337cb1a7c4b9fe31feb76609e1 /inc/functions.php
parent2273ae5645417629ac03a8be413c5c1b7b36461f (diff)
bugfix: PHP notices when uploading a non-image file
Diffstat (limited to 'inc/functions.php')
-rw-r--r--inc/functions.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/inc/functions.php b/inc/functions.php
index 05bfd598..80b85a4e 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -708,8 +708,15 @@
$query->bindValue(':thumbwidth', $post['thumbwidth'], PDO::PARAM_INT);
$query->bindValue(':thumbheight', $post['thumbheight'], PDO::PARAM_INT);
$query->bindValue(':file', $post['file']);
- $query->bindValue(':width', $post['width'], PDO::PARAM_INT);
- $query->bindValue(':height', $post['height'], PDO::PARAM_INT);
+
+ if(isset($post['width'], $post['height'])) {
+ $query->bindValue(':width', $post['width'], PDO::PARAM_INT);
+ $query->bindValue(':height', $post['height'], PDO::PARAM_INT);
+ } else {
+ $query->bindValue(':width', null, PDO::PARAM_NULL);
+ $query->bindValue(':height', null, PDO::PARAM_NULL);
+ }
+
$query->bindValue(':filesize', $post['filesize'], PDO::PARAM_INT);
$query->bindValue(':filename', $post['filename']);
$query->bindValue(':filehash', $post['filehash']);