Welcome to the LimeSurvey Community Forum

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

Deactivate tag stripping

  • Hulotte
  • Hulotte's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 8 months ago #172605 by Hulotte
Deactivate tag stripping was created by Hulotte
Hi!

I habe tried to find a solution to my problems now for several hours but I seem to be stuck...

I want to include an image into my question help text. But whenever I start the survey and get to the question, there is no picture (it appears and disappears immeditaley).

What I did:
In the question.pstpl file I changed
  • {if(!is_empty(trim(strip_tags(QUESTIONHELP))),"<div class='survey-question-help'>"+QUESTIONHELP+"</div>","")}
  • into: <div class='survey-question-help'>{QUESTIONHELP}</div>
This did not help at all.

I then deleted the class 'survey-question-help'. That did the trick but then the css is messed up a little.

I concluded that there must be another tag stripper somewhere. But where?!

Any ideas, suggestions and help is very much appreciated.

I am using Version 2.05+ Build 140320 of LimeSurvey.

Thank you very much!
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 8 months ago #172607 by holch
Replied by holch on topic Deactivate tag stripping
You have to deactivate the XSS Filter on your LS installation. I don't have such an old version (more than 4 years, you should really update), so I can't tell you the path.

But should be in General settings for the installation under "Security" or something.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • Hulotte
  • Hulotte's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 8 months ago #172608 by Hulotte
Replied by Hulotte on topic Deactivate tag stripping
Thank you for the quick reply!

I don't have access to the Security Settings but I will contact our server administrator. And about the update, same reason here.

If there is any other idea/possibility on how to fix this, I'd be happy if you let me know.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 8 months ago #172609 by holch
Replied by holch on topic Deactivate tag stripping
Let me think: If you use the WYSIWYG-Editor, it should allow you insert images. Not sure though.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • Hulotte
  • Hulotte's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 8 months ago #172610 by Hulotte
Replied by Hulotte on topic Deactivate tag stripping
I can insert them in the editor, they are just not displayed.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 8 months ago #172611 by holch
Replied by holch on topic Deactivate tag stripping
Well, then it probably doesn't work that way either.

I never use the editor and I have the XSS-Filter switched off, so I generally don't have to think about those problems.

But wait: "it appears and disappears immeditaley"

This sounds strange. If the problem would be the XSS filter, than the code should be filtered already. Can you provide a link to your survey? Does the image tag appear in the source code?

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: Hulotte
The topic has been locked.
  • Hulotte
  • Hulotte's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 8 months ago - 5 years 8 months ago #172612 by Hulotte
Replied by Hulotte on topic Deactivate tag stripping
The image tag is still in the source code on the page. That is strange, yes.

The survey is closed to public so I am afraid I cannot supply a link.

I just tested the survey while JS deactivated. Then the picture shows up.

Any idea how I can find out which JS does this?
Last edit: 5 years 8 months ago by Hulotte.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 8 months ago #172614 by holch
Replied by holch on topic Deactivate tag stripping
I have no idea. But at least you know that the problem is NOT the XSS filter, because otherwise the image tag should not appear.

Have you tested this with a different computer? Where are you hosting the image? Do you run some kind of ad blocker?

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • Hulotte
  • Hulotte's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 8 months ago #172615 by Hulotte
Replied by Hulotte on topic Deactivate tag stripping
But that was a good hint!

I found the function in the template.js:

// Remove help-image for the DOM because we don't use it
$('.survey-question-help').each(function(){
$(this).find('img').detach();
});

The assumption that "we" don't use help-images is a little odd, though...

I removed the part and now it works!

Thank you very much for your help!
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 8 months ago #172618 by holch
Replied by holch on topic Deactivate tag stripping
Can you write a bug report? Just because the developer of the them did not want to show a specific image, others (like you) might want to show images there. They should just not include the image, then they don't need to do this.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 8 months ago #172624 by tpartner
Replied by tpartner on topic Deactivate tag stripping
I don't think there is any point in submitting a bug report for a custom template in 2.05.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • Hulotte
  • Hulotte's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 8 months ago #172627 by Hulotte
Replied by Hulotte on topic Deactivate tag stripping
It was well intended.

But I just tested using pictures in help texts with the newest release. This problem does not occur anymore.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose