If exportFileName hook isn’t defined don’t return empty filename.

This commit should fix #2251.

If ``exportFileName`` hook is not defined, ``hookFileName`` should be an empty array. Test the length of ``hookFileName`` before overriding ``fileName``, the export filename.
pull/2252/head
Olivier Tétard 2014-09-28 14:53:07 +02:00
parent 2e6348b8aa
commit bfde869948
1 changed files with 1 additions and 1 deletions

View File

@ -52,7 +52,7 @@ exports.doExport = function(req, res, padId, type)
hooks.aCallFirst("exportFileName", padId, hooks.aCallFirst("exportFileName", padId,
function(err, hookFileName){ function(err, hookFileName){
// if fileName is set then set it to the padId, note that fileName is returned as an array. // if fileName is set then set it to the padId, note that fileName is returned as an array.
if(hookFileName) fileName = hookFileName; if(hookFileName.length) fileName = hookFileName;
//tell the browser that this is a downloadable file //tell the browser that this is a downloadable file