Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getPreEscape example
$class
= \
get_class
(
$node
)
;
return
new
$class
(
$this
->
getEscaperFilter
(
$type
,
$expression
)
,
$node
->
getTemplateLine
(
)
)
;
}
private
function
preEscapeFilterNode
(
FilterExpression
$filter
, Environment
$env
)
: FilterExpression
{
$name
=
$filter
->
getNode
(
'filter'
)
->
getAttribute
(
'value'
)
;
$type
=
$env
->
getFilter
(
$name
)
->
getPreEscape
(
)
;
if
(
null ===
$type
)
{
return
$filter
;
}
$node
=
$filter
->
getNode
(
'node'
)
;
if
(
$this
->
isSafeFor
(
$type
,
$node
,
$env
)
)
{
return
$filter
;
}
$filter
->
setNode
(
'node',
$this
->
getEscaperFilter
(
$type
,
$node
)
)
;