diff --git a/frontend/src/pages/file-history-old/history-item.js b/frontend/src/pages/file-history-old/history-item.js index 204fbd6a0f..930a0f1232 100644 --- a/frontend/src/pages/file-history-old/history-item.js +++ b/frontend/src/pages/file-history-old/history-item.js @@ -46,8 +46,8 @@ class HistoryItem extends React.Component { let item = this.props.item; let downloadUrl = URLDecorator.getUrl({type: 'download_historic_file', filePath: filePath, objID: item.rev_file_id}); let userProfileURL = `${siteRoot}profile/${encodeURIComponent(item.creator_email)}/`; - let viewUrl = `${siteRoot}repo/${historyRepoID}/history/files/?obj_id=${item.rev_file_id}&commit_id=${item.commit_id}&p=${filePath}`; - let diffUrl = `${siteRoot}repo/text_diff/${historyRepoID}/?commit=${item.commit_id}&p=${filePath}`; + let viewUrl = `${siteRoot}repo/${historyRepoID}/history/files/?obj_id=${item.rev_file_id}&commit_id=${item.commit_id}&p=${Utils.encodePath(filePath)}`; + let diffUrl = `${siteRoot}repo/text_diff/${historyRepoID}/?commit=${item.commit_id}&p=${Utils.encodePath(filePath)}`; return ( diff --git a/frontend/src/utils/url-decorator.js b/frontend/src/utils/url-decorator.js index a0e74f24f3..dec4e4fbc0 100644 --- a/frontend/src/utils/url-decorator.js +++ b/frontend/src/utils/url-decorator.js @@ -7,7 +7,7 @@ class URLDecorator { let params = ''; switch (options.type) { case 'download_historic_file': - params = 'p=' + options.filePath; + params = 'p=' + Utils.encodePath(options.filePath); url = siteRoot + 'repo/' + historyRepoID + '/' + options.objID + '/download?' + params; break; case 'download_file_url':