Custom-encode forward slashes in URL parameters as Apache HTTPD doesn't allow them in some cases. Fixes #3998

This commit is contained in:
Murtuza Zabuawala
2019-03-01 14:55:25 +00:00
committed by Dave Page
parent ecbba79c2a
commit 36ffdb93e8
6 changed files with 93 additions and 17 deletions

View File

@@ -195,6 +195,22 @@ define(['jquery', 'sources/gettext', 'sources/url_for'],
}
return '1em';
},
removeSlashInTheString: (value) => {
let locationList = [];
let idx = 0;
while (value && value.indexOf('/') !== -1) {
locationList.push(value.indexOf('/') + idx);
value = value.replace('/', '');
// No of slashes already removed, so we need to increment the
// index accordingly when adding into location list
idx++;
}
return {
'slashLocations': locationList.join(','),
'title': encodeURIComponent(value),
};
},
};
return sqlEditorUtils;
});