mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 08:22:07 +02:00
MDL-36959 file_storage: Preserve each file in a hash collision
This commit is contained in:
parent
e9cd87eef2
commit
946f2b0826
@ -1607,7 +1607,7 @@ class file_storage {
|
||||
if (sha1_file($hashfile) === $contenthash) {
|
||||
// Jackpot! We have a sha1 collision.
|
||||
mkdir("$this->filedir/jackpot/", $this->dirpermissions, true);
|
||||
copy($hashfile, "$this->filedir/jackpot/{$contenthash}_1");
|
||||
copy($pathname, "$this->filedir/jackpot/{$contenthash}_1");
|
||||
copy($hashfile, "$this->filedir/jackpot/{$contenthash}_2");
|
||||
throw new file_pool_content_exception($contenthash);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user