Skip to content

Commit

Permalink
Data masking: files with url encoded names not showing #840073
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason.Platts authored and sammarshallou committed Nov 18, 2024
1 parent a497a39 commit c49ed5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions classes/files_mask.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ protected function replace_filename(\stdClass $rec, string $newfilename): void {
$sql = "UPDATE {oublog_posts}
SET message = REPLACE(message, ?, ?)
WHERE id = ?";
$DB->execute($sql, [$rec->filename, $newfilename, $rec->itemid]);
$DB->execute($sql, [rawurlencode($rec->filename), rawurlencode($newfilename), $rec->itemid]);
// Update edits.
$sql = "UPDATE {oublog_edits}
SET oldmessage = REPLACE(oldmessage, ?, ?)
WHERE postid = ?";
$DB->execute($sql, [$rec->filename, $newfilename, $rec->itemid]);
$DB->execute($sql, [rawurlencode($rec->filename), rawurlencode($newfilename), $rec->itemid]);
}
}
}

0 comments on commit c49ed5a

Please sign in to comment.