From ec90ee5a09deebd6e6c2e490686bb0c30e0deeb4 Mon Sep 17 00:00:00 2001 From: steinm Date: Fri, 8 Feb 2013 14:52:32 +0000 Subject: [PATCH] - check if new file is identical to current version --- op/op.UpdateDocument.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/op/op.UpdateDocument.php b/op/op.UpdateDocument.php index 4ae249eb2..e8f18541c 100644 --- a/op/op.UpdateDocument.php +++ b/op/op.UpdateDocument.php @@ -80,6 +80,12 @@ if ($_FILES['userfile']['error'] == 0) { UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("uploading_failed")); } +/* Check if the uploaded file is identical to last version */ + $lc = $document->getLatestContent(); + if($lc->getChecksum() == LetoDMS_Core_File::checksum($userfiletmp)) { + UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("identical_version")); + } + $lastDotIndex = strrpos(basename($userfilename), "."); if (is_bool($lastDotIndex) && !$lastDotIndex) $fileType = ".";