diff --git a/osf_tests/test_archiver.py b/osf_tests/test_archiver.py index 79382faab18..8658613890d 100644 --- a/osf_tests/test_archiver.py +++ b/osf_tests/test_archiver.py @@ -587,7 +587,7 @@ def test_archive_success(self): def test_archive_success_escaped_file_names(self): file_tree = file_tree_factory(0, 0, 0) fake_file = file_factory(name='>and&and<') - fake_file_name = strip_html(fake_file['name']) + fake_file_name = strip_html(fake_file['name']).replace('&', '&') file_tree['children'] = [fake_file] node = factories.NodeFactory(creator=self.user) diff --git a/website/archiver/utils.py b/website/archiver/utils.py index 765425f9445..fae44a40a2b 100644 --- a/website/archiver/utils.py +++ b/website/archiver/utils.py @@ -322,7 +322,7 @@ def _make_file_response(file_info, parent_guid): archived_file_id = file_info['path'].lstrip('/') return { 'file_id': archived_file_id, - 'file_name': bleach.clean(file_info['name']), + 'file_name': bleach.clean(file_info['name']).replace('&', '&'), 'file_urls': { 'html': FILE_HTML_LINK_TEMPLATE.format(