Skip to content

PHP Fatal error: Uncaught Twig_Error_Syntax: Unknown "addslashes" filter ... #64

Description

@Petervw

Using the Twig extractor we've had a fatal error on a semi-custom filter.

$twig->addFilter(new Twig_SimpleFilter('addslashes', 'addslashes'));

Our twig template:

<div>{{ content.content|raw|addslashes }}</div>

Problem: We cannot use the default sanitization from Twig, we need the raw string with real HTML characters.

This will result in the following fatal error from the extractor:

PHP Fatal error:  Uncaught Twig_Error_Syntax: Unknown "addslashes" filter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions