MDL-58297 core: Update to use new hashing functions

This commit is contained in:
Andrew Nicols 2017-03-17 15:21:59 +08:00
parent a30a04fa01
commit e6a4780452
6 changed files with 18 additions and 14 deletions

View file

@ -1722,7 +1722,7 @@ abstract class repository implements cacheable_object {
// size, and a contenthash which does not related to empty content.
// If thereis no file size, or the contenthash is for an empty file, then the file has
// yet to be successfully downloaded.
$contentexists = $file->get_filesize() && $file->get_contenthash() !== sha1('');
$contentexists = $file->get_filesize() && !$file->compare_to_string('');
if (!$file->get_status() && $contentexists) {
// we already have the content in moodle filepool and it was synchronised recently.