Fixed database cleanup on file deletion
authorJean-Michel Vourgère <jvourger@greenpeace.org>
Wed, 8 Mar 2017 14:30:34 +0000 (14:30 +0000)
committerJean-Michel Vourgère <jvourger@greenpeace.org>
Thu, 9 Mar 2017 18:06:31 +0000 (18:06 +0000)
webroot/squasher.class.php

index 86e1cbb327a475a40b13fe2a3d9168577a140eb5..3931bfe5bbd3c0e195efbf61c4b9d2ffbfbd2b59 100644 (file)
@@ -954,7 +954,7 @@ function delete_file($h, $s) {
        }
 
        #Update DB
-       $q = "DELETE FROM file_hash WHERE file_hash = '".mysql_escape_string($h)."'";
+       $q = "DELETE FROM file_hash WHERE md5_hash = '".mysql_escape_string($h)."'";
        mysql_query($q);
        $q = "INSERT INTO log (hash,file,action,user_id,user_name,ip,date) VALUES ('".mysql_escape_string($h)."','".mysql_escape_string($filepath)."','delete',".(int)$s['user_id'].",'".mysql_escape_string($s['user_name'])."','".mysql_escape_string($_SERVER['REMOTE_ADDR'])."',NOW())";
        mysql_query($q);