Welcome to the LimeSurvey Community Forum

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

"<br>" is dropped from attributes

  • UmfragenKitzingen
  • UmfragenKitzingen's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 2 months ago #210636 by UmfragenKitzingen
"<br>" is dropped from attributes was created by UmfragenKitzingen
Dear forum,

I want to display the address of respondents to allow them to make corrections. Therefore I have a string like "company<br>street 1<br>12345 city" in  my csv-file. This worked fine for the last few weeks.

However, as I want to add additional respondents, somehow the "<br>" are now deleted from the string after uploading them from a csv-file. The same is true if I insert them manually.

 

 

Does anybody have a solution for this problem? I am using LS 3.25.7.

Many thanks!
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 2 months ago #210643 by DenisChenu
Replied by DenisChenu on topic "<br>" is dropped from attributes
Yes, there are issue with this functionnality,

One for functionality : bugs.limesurvey.org/view.php?id=16853
One for security : bugs.limesurvey.org/view.php?id=16884

The solution choosen between : strip tags or just filter was striptags.

Depend where you use your attribute, but with Expression :
Use
Code:
{str_replace("[","<",str_replace(">","]",TOKEN:ATTRIBUTE_2))}
Use html encode (must be test) ( &gt; and &lt;)
Code:
{html_entity_decode(TOKEN:ATTRIBUTE_2)}
 

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: UmfragenKitzingen
The topic has been locked.
  • UmfragenKitzingen
  • UmfragenKitzingen's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 2 months ago #210647 by UmfragenKitzingen
Replied by UmfragenKitzingen on topic "<br>" is dropped from attributes
Thank you very much for your help! Both solutions work for me.

I switched the order of the square brackets within the replace function:

{str_replace("]",">",str_replace("[","<",TOKEN:ATTRIBUTE_1))}

Otherwise it replaced the text after the first part of the string with blank lines (or something similar).

The only drawback is that there is a grey box around the token - but at least I can continue with the format of the survey as it is!

 
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 2 months ago - 3 years 2 months ago #210652 by DenisChenu
Replied by DenisChenu on topic "<br>" is dropped from attributes
Right : i make an error in the function

Aboyut grey part : Strange ?

Can you send a sample lsa with just one false question andf one false token please ?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 3 years 2 months ago by DenisChenu.
The topic has been locked.
  • UmfragenKitzingen
  • UmfragenKitzingen's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 2 months ago #211064 by UmfragenKitzingen
Replied by UmfragenKitzingen on topic "<br>" is dropped from attributes
Maybe I did not express myself correctly - I meant a box around the attribute in the question display:

 

Thank you very much for looking into this!
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 2 months ago #211065 by DenisChenu
Replied by DenisChenu on topic "<br>" is dropped from attributes
Strange !
I don't understand why this pre tag was added …

Thanks for the LSA, your explanation was clear enough (i understand)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 2 months ago #211066 by DenisChenu
Replied by DenisChenu on topic "<br>" is dropped from attributes
OK,Got it : i think you copy/paste from this forum, then you coipy the pre tag 

  

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • UmfragenKitzingen
  • UmfragenKitzingen's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 2 months ago #211068 by UmfragenKitzingen
Replied by UmfragenKitzingen on topic "<br>" is dropped from attributes
I see I should have checked this beforehand. A similar problem took me half a day, so I was basically aware of the downsides of copy/paste.

Again, thank you very much!
The following user(s) said Thank You: DenisChenu
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose