From b36f4674a0ba2f4b6e76481dec2905494a3e2b78 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Wed, 16 Apr 2014 20:49:02 -0400 Subject: [PATCH] Bug 6874: id based on contents, filename, and directory. This patch corrects the inability to upload the same file to a different directory, or even a renamed file to the same directory. By including the filename and directory as part of the $id SHA generation, only identical files in the same directory with the same file name will generate the same $id. Signed-off-by: Bernardo Gonzalez Kriegel Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- C4/UploadedFiles.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/C4/UploadedFiles.pm b/C4/UploadedFiles.pm index 6248eaae18..341b5b6966 100644 --- a/C4/UploadedFiles.pm +++ b/C4/UploadedFiles.pm @@ -150,6 +150,8 @@ sub UploadFile { my $sha = new Digest::SHA; $sha->add($data); + $sha->add($filename); + $sha->add($dir); my $id = $sha->hexdigest; # Test if this id already exist -- 2.39.5