Merge pull request #12430 from birarda/feat/pending-content-archives

make filename regex less restrictive
This commit is contained in:
Stephen Birarda 2018-02-16 18:21:56 -07:00 committed by GitHub
commit 1e36a5b218
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View file

@ -54,7 +54,7 @@ $(document).ready(function(){
var fileFormData = new FormData();
fileFormData.append('restore-file', files[0]);
showSpinnerAlert("Restoring Content");
showSpinnerAlert("Uploading content to restore");
$.ajax({
url: '/content/upload',
@ -65,7 +65,6 @@ $(document).ready(function(){
data: fileFormData
}).done(function(data, textStatus, jqXHR) {
swal.close();
showRestartModal();
}).fail(function(jqXHR, textStatus, errorThrown) {
showErrorMessage(
"Error",

View file

@ -2247,7 +2247,7 @@ bool DomainServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url
// check the file extension to see what kind of file this is
// to make sure we handle this filetype for a content restore
auto dispositionValue = QString(firstFormData.first.value("Content-Disposition"));
auto formDataFilenameRegex = QRegExp("filename=\"(\\S+)\"");
auto formDataFilenameRegex = QRegExp("filename=\"(.+)\"");
auto matchIndex = formDataFilenameRegex.indexIn(dispositionValue);
QString uploadedFilename = "";