Skip to content

Commit

Permalink
Merge pull request #684 from hpi-studyu/fix/zip-encoding-sanitize
Browse files Browse the repository at this point in the history
fix: hotfix to sanitize export contents
  • Loading branch information
johannesvedder authored Sep 5, 2024
2 parents 7c1fe6f + a462b33 commit 0c8423c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion designer_v2/lib/features/analyze/study_export_zip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ extension StudyExportZipX on StudyExportData {
};

files.forEach((filename, content) {
final archiveFile = ArchiveFile.string(filename, content);
final archiveFile = ArchiveFile.string(
filename,
// todo sanitize contents manually until archive v4 is released
content.replaceAll('’', "'").replaceAll('…', '...'),
);
archive.addFile(archiveFile);
});

Expand Down
2 changes: 1 addition & 1 deletion designer_v2/lib/utils/file_download.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dynamic downloadFile({required String fileContent, required String filename}) {
void downloadBytes({required List<int> bytes, required String filename}) {
if (!kIsWeb) {
throw Exception(
"The StudyU designer only support the web platform".hardcoded,
"The StudyU Designer only support the web platform".hardcoded,
);
}
final content = base64Encode(bytes);
Expand Down

0 comments on commit 0c8423c

Please sign in to comment.