Skip to content
Browse files

Fix duplicate filename check

pomf is the database, not the table. name is also non-existent. it
should be filename.
  • Loading branch information...
LolcatsV2 committed Dec 18, 2015
1 parent b117771 commit d8009384592b6eaab6a3a830b88c4cc2c4dcb0c4
Showing with 1 addition and 1 deletion.
  1. +1 −1 static/upload.php
@@ -51,7 +51,7 @@ function generate_name ($file) {
$name .= '.' . strip_tags($ext);
// Check if a file with the same name does already exist in the database
$q = $db->prepare('SELECT COUNT(name) FROM pomf WHERE name = (:name)');
$q = $db->prepare('SELECT COUNT(filename) FROM files WHERE filename = (:name)');
$q->bindValue(':name', $name, PDO::PARAM_STR);
$result = $q->fetchColumn();

0 comments on commit d800938

Please sign in to comment.
You can’t perform that action at this time.