View Issue Details

This bug affects 1 person(s).
 12
IDProjectCategoryView StatusLast Update
13732Feature requestsTheme editorpublic2024-12-03 11:41
ReporterQuoTil Assigned Totibor.pacalat  
PrioritynoneSeverityfeature 
Status closedResolutionfixed 
Summary13732: Twig - add "striptags" allowed filters
Description

Please add the twig-function "striptags" to the list of allowed filters.

Steps To Reproduce

See the issue incl. the suggestion to report this as a bug here: here https://www.limesurvey.org/forum/design-issues/115436-ls3-x-change-question-style-by-theme-tylesheet-not-inline-via-question-editing#169437

TagsNo tags attached.
Bug heat12
Story point estimate
Users affected %

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2018-06-01 15:50

developer   ~47939

Last edited: 2018-06-01 15:51

Can you try adding
'components' => array(
[…]
'twigRenderer' => array(
'sandboxConfig' => array(
filters' => array(
'striptags',
),
),
),
[…]

),

in your config.php file ?

If it don't work : try with function (2 times for one function)

DenisChenu

DenisChenu

2018-06-01 17:42

developer   ~47940

Adding filter in config work, but really seems to be a needed fiter.
https://www.limesurvey.org/forum/design-issues/115436-ls3-x-change-question-style-by-theme-tylesheet-not-inline-via-question-editing#169452

Unsure for function

LouisGac

LouisGac

2018-06-04 14:04

developer   ~47962

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=27303

LouisGac

LouisGac

2018-06-04 14:06

developer   ~47963

by the way, it's strip_tags, with an underscore
http://php.net/manual/en/function.strip-tags.php

markusfluer

markusfluer

2018-08-07 17:01

administrator   ~48736

Release 3.14.2+180807

tibor.pacalat

tibor.pacalat

2024-11-21 13:49

administrator   ~81483

@DenisChenu, Mazi says:

The applied fix seems to be wrong. We are still facing the issue at latest 5.x and 6.x versions.

This...
https://github.com/LimeSurvey/LimeSurvey/blob/master/application/config/internal.php#L352
https://github.com/LimeSurvey/LimeSurvey/blob/master/application/config/internal.php#L433
...has to be "striptags" which is the official function name: https://twig.symfony.com/doc/3.x/filters/striptags.html

DenisChenu

DenisChenu

2024-11-21 16:22

developer   ~81486

functions is PHP function

https://twig.symfony.com/doc/3.x/filters/striptags.html is a filter, not a function

I think i get the error here

Mazi

Mazi

2024-11-21 16:32

updater   ~81488

@DeniChenu, I think all that needs to be done is using "striptags" instead of "strip_tags" (with underscore)?!

DenisChenu

DenisChenu

2024-11-21 16:36

developer   ~81489

Fixed : add strip_tags function
Feature : allow striptags filter

{{ strip_tags(aQuestion.text) }} or {{ aQuestion.text | striptags }}

Can you check both when testing ?
https://github.com/LimeSurvey/LimeSurvey/pull/4052

Mazi

Mazi

2024-11-21 19:13

updater   ~81491

@DenisChenu, both options worked fine at my tests.
Thanks for fixing this so fast!

LimeBot

LimeBot

2024-12-03 11:41

administrator   ~81567

Fixed in Release 6.8.2+241203

Related Changesets

LimeSurvey: master fc48346c

2018-06-04 16:03

LouisGac


Details Diff
New feature 13732: Twig - add "striptags" allowed filters Affected Issues
13732
mod - application/config/internal.php Diff File

Issue History

Date Modified Username Field Change
2018-06-01 15:22 QuoTil New Issue
2018-06-01 15:50 DenisChenu Note Added: 47939
2018-06-01 15:51 DenisChenu Note Edited: 47939
2018-06-01 17:41 DenisChenu Project Bug reports => Feature requests
2018-06-01 17:42 DenisChenu Assigned To => LouisGac
2018-06-01 17:42 DenisChenu Status new => assigned
2018-06-01 17:42 DenisChenu Severity @50@ => feature
2018-06-01 17:42 DenisChenu Note Added: 47940
2018-06-04 14:04 LouisGac Changeset attached => LimeSurvey master fc48346c
2018-06-04 14:04 LouisGac Note Added: 47962
2018-06-04 14:04 LouisGac Resolution open => fixed
2018-06-04 14:05 LouisGac Status assigned => resolved
2018-06-04 14:06 LouisGac Status resolved => feedback
2018-06-04 14:06 LouisGac Resolution fixed => reopened
2018-06-04 14:06 LouisGac Note Added: 47963
2018-06-04 14:06 LouisGac Status feedback => resolved
2018-08-07 17:01 markusfluer Status resolved => closed
2018-08-07 17:01 markusfluer Note Added: 48736
2024-11-21 13:48 tibor.pacalat Assigned To LouisGac => DenisChenu
2024-11-21 13:48 tibor.pacalat Status closed => assigned
2024-11-21 13:49 tibor.pacalat Note Added: 81483
2024-11-21 13:49 tibor.pacalat Bug heat 6 => 8
2024-11-21 16:22 DenisChenu Note Added: 81486
2024-11-21 16:32 Mazi Note Added: 81488
2024-11-21 16:32 Mazi Bug heat 8 => 10
2024-11-21 16:36 DenisChenu Note Added: 81489
2024-11-21 16:36 DenisChenu Assigned To DenisChenu => gabrieljenik
2024-11-21 16:36 DenisChenu Status assigned => ready for code review
2024-11-21 19:13 Mazi Note Added: 81491
2024-11-22 14:05 gabrieljenik Assigned To gabrieljenik => tibor.pacalat
2024-11-22 14:05 gabrieljenik Status ready for code review => ready for testing
2024-11-22 17:44 tibor.pacalat Status ready for testing => resolved
2024-11-22 17:44 tibor.pacalat Resolution reopened => fixed
2024-12-03 11:41 LimeBot Note Added: 81567
2024-12-03 11:41 LimeBot Status resolved => closed
2024-12-03 11:41 LimeBot Bug heat 10 => 12