CartoDB-SQL-API/app/utils/filename_sanitizer.js
2015-12-03 17:28:18 +01:00

10 lines
240 B
JavaScript

'use strict';
var path = require('path');
module.exports = function sanitize_filename(filename) {
filename = path.basename(filename, path.extname(filename));
filename = filename.replace(/[;()\[\]<>'"\s]/g, '_');
return filename;
};