Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion cleaner/sitedata/classes/clean.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ static public function execute() {

// Filename and pathnamehash are staying the same
// to ensure the pathnamehash stays unique.
[$contextlevelsql, $contextlevelparams] = $DB->get_in_or_equal($contextlevels);
$sql = "UPDATE {files}
SET contenthash = ?,
filesize = ?,
Expand All @@ -166,13 +167,18 @@ static public function execute() {
referencefileid = null,
author = null,
source = null
WHERE mimetype = ?";
WHERE mimetype = ?
AND contextid IN (
SELECT id
FROM {context}
WHERE contextlevel " . $contextlevelsql . ")";
$params = array();
$params[] = $contenthash;
$params[] = $filesize;
$params[] = $newmimetype;
$params[] = $status;
$params[] = $mimetype;
$params = array_merge($params, $contextlevelparams);
$DB->execute($sql, $params);
self::next_step();
}
Expand Down