Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

iframe and other code changed and crashed after clicking 'save' V.3.25.4

  • CoraZHAO
  • CoraZHAO's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 3 months ago #210148 by CoraZHAO
I found a very werid and headache issue in V3.25.4.
That is, once I opened the questions (in English version)which have iframe videos, even if I didn't change anything and just click 'save'. All codes inserted before changed and can't work porperly.


e.g. the correct code for randomly show video No.2
Code:
<iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" frameborder="0" height="600" src="https://www.youtube.com/embed/{Scene2}?rel=0&amp;amp;autoplay=1" width="1100"></iframe>

Changed into
Code:
{Scene2}?rel=0&amp;autoplay=1" width="1100">
after I click 'save'.
I tried to import these questions again and it works well, as long as I did't edit and save them.
See attached my quetsion groups

File Attachment:

File Name: limesurvey...1422.lsg
File Size:25 KB




But the Dutch version still need to be add so I must edit these questions.

To figure out what's going on. I also tried the 'insert youtube video' button in my editor and add a new video. Once I clicked save. The same issue appeard ( all codes changed and crashed).


Even worse,
Sourcecode in Question'Q0' for generating random numbers also crashed. The original code is,
Code:
<script type="text/javascript" charset="utf-8">
 
function shuffle(array) {
  var currentIndex = array.length, temporaryValue, randomIndex;
 
  // While there remain elements to shuffle...
  while (0 !== currentIndex) {
 
    // Pick a remaining element...
    randomIndex = Math.floor(Math.random() * currentIndex);
    currentIndex -= 1;
 
    // And swap it with the current element.
    temporaryValue = array[currentIndex];
    array[currentIndex] = array[randomIndex];
    array[randomIndex] = temporaryValue;
  }
 
  return array;
}
 
 
  $(document).on('ready pjax:scriptcomplete',function(){
// Fill the array
      var arr = [1,2,3,4,5,6,7,8];
      arr = shuffle(arr);
      anumbers = arr.slice(0,4).join('');
      $('#question{QID} input[type="text"]').val(anumbers);
      $('#question{QID}').hide();
   });
</script>

Now it looks like,
Code:
QID input[type="text"]').val(anumbers); $('#questionQID').hide(); });

I tried to fix it by inserting the correct code again many times. But once I clicked 'save'. it will change into the short and wrong code....


Another survey with exactly the same code works just fine 3 weeks ago. (V3.23.3)
Same PC, same browser, but a higher version of Limesurvey.( V3.25.4.)

I think it is something to do with the Lime editor or iframe update since it never happened before.

I'll be very appriciated if anybody know the answers....

Best,
Yuwen.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 3 months ago #210150 by tpartner
I suspect that the XSS filter is enabled.

- manual.limesurvey.org/Global_settings#Security

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • CoraZHAO
  • CoraZHAO's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 3 months ago #210241 by CoraZHAO
Dear tpartner,
You are right.
I contacted my Admin. That was because she switched on XSS in global settings and didn't inform me.
Now she disabled it and the problem solved!

Thank you so much for your help!

Best regards,
Yuwen
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose