fix import issue with txt files and abiword #2572

pull/2566/head
John McLear 2015-04-01 00:19:42 +01:00
parent 733deb613e
commit fef746e80e
1 changed files with 4 additions and 2 deletions

View File

@ -148,6 +148,9 @@ exports.doImport = function(req, res, padId)
if(!importHandledByPlugin || !directDatabaseAccess){ if(!importHandledByPlugin || !directDatabaseAccess){
var fileEnding = path.extname(srcFile).toLowerCase(); var fileEnding = path.extname(srcFile).toLowerCase();
var fileIsHTML = (fileEnding === ".html" || fileEnding === ".htm"); var fileIsHTML = (fileEnding === ".html" || fileEnding === ".htm");
var fileIsTXT = (fileEnding === ".txt");
if (fileIsTXT) abiword = false; // Don't use abiword for text files
// See https://github.com/ether/etherpad-lite/issues/2572
if (abiword && !fileIsHTML) { if (abiword && !fileIsHTML) {
abiword.convertFile(srcFile, destFile, "htm", function(err) { abiword.convertFile(srcFile, destFile, "htm", function(err) {
//catch convert errors //catch convert errors
@ -245,7 +248,6 @@ exports.doImport = function(req, res, padId)
padManager.getPad(padId, function(err, _pad){ padManager.getPad(padId, function(err, _pad){
var pad = _pad; var pad = _pad;
padManager.unloadPad(padId); padManager.unloadPad(padId);
// direct Database Access means a pad user should perform a switchToPad // direct Database Access means a pad user should perform a switchToPad
// and not attempt to recieve updated pad data.. // and not attempt to recieve updated pad data..
if(!directDatabaseAccess){ if(!directDatabaseAccess){