Skip to content

Commit

Permalink
fixed #6887: Unable to import lss files in 2.1
Browse files Browse the repository at this point in the history
dev: Schnoulle could you verify this is correct?
  • Loading branch information
mennodekker committed Nov 16, 2012
1 parent 453cd65 commit 4faf6d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions application/helpers/admin/import_helper.php
Expand Up @@ -1644,7 +1644,7 @@ function CSVImportQuestion($sFullFilepath, $iNewSID, $newgid)
$questionrowdata['language']=$answerrowdata['language'];
$questionrowdata['tid']=$typeresult['tid'];
$questionrowdata['type']=$typeresult['type']; //AJSL
if ($xssfilter)
if ($questionrowdata)
XSSFilterArray($questionrowdata);
$question = new Questions;
foreach ($questionrowdata as $k => $v)
Expand Down Expand Up @@ -1854,7 +1854,7 @@ function XMLImportQuestion($sFullFilepath, $iNewSID, $newgid)
$insertdata['tid'] = Question_types::model()->findByAttributes(array('class' => $insertdata['class']))->getAttribute('tid');
unset($insertdata['class']);
}
if ($xssfilter)
if ($insertdata)
XSSFilterArray($insertdata);
$ques = new Questions;
foreach ($insertdata as $k => $v)
Expand Down Expand Up @@ -3654,7 +3654,7 @@ function XMLImportSurvey($sFullFilepath,$sXMLdata=NULL,$sNewSurveyName=NULL,$iDe
$insertdata['tid'] = Question_types::model()->findByAttributes(array('class' => $insertdata['class']))->getAttribute('tid');
unset($insertdata['class']);
}
if ($xssfilter)
if ($insertdata)
XSSFilterArray($insertdata);
$newqid = Questions::model()->insertRecords($insertdata) or safeDie($clang->gT("Error").": Failed to insert data [4]<br />");
if (!isset($aQIDReplacements[$oldqid]))
Expand Down Expand Up @@ -3707,7 +3707,7 @@ function XMLImportSurvey($sFullFilepath,$sXMLdata=NULL,$sNewSurveyName=NULL,$iDe
$insertdata['tid'] = Question_types::model()->findByAttributes(array('class' => $insertdata['class']))->getAttribute('tid');
unset($insertdata['class']);
}
if ($xssfilter)
if ($insertdata)
XSSFilterArray($insertdata);
$newsqid =Questions::model()->insertRecords($insertdata) or safeDie($clang->gT("Error").": Failed to insert data [5]<br />");
if (!isset($insertdata['qid']))
Expand Down

3 comments on commit 4faf6d9

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's another issue now : but in /application/modules/CheckQuestion.php

@c-schmitz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the XSS filter needed at all in import anymore? Shnoulle, didn't you implement it at model level?

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not in survey model.

It can be done, but for 2.0 or 2.1 ? (working in 2.0 actually)

And there a lot of databse system don't use models

Please sign in to comment.