Exercise/HTMLPurifierBundle

Custom config for Youtube's iframe

Closed this issue · 1 comments

Env / SF2.8
I'm trying to add config for allowing iframe from YouTube, here's my config.yml:

# HTMLPurifierBundle
exercise_html_purifier:
    default:
        Cache.SerializerPath: "%kernel.root_dir%/cache/htmlpurifier"
    custom:
        HTML.SafeIframe: true
        URI.SafeIframeRegexp: '%^http://www.youtube.com/embed/%'

But I've got this error:

ParameterNotFoundException in ParameterBag.php line 84:
You have requested a non-existent parameter "^http://www.youtube.com/embed/".

What's wrong?
Thanks!

OK with this config

exercise_html_purifier:
    default:
        Cache.SerializerPath: "%kernel.root_dir%/cache/htmlpurifier"
    custom:
        Cache.SerializerPath: "%kernel.root_dir%/cache/htmlpurifier"
        HTML.SafeIframe: true
        URI.SafeIframeRegexp: "#^(https?:)?//(www\.youtube(?:-nocookie)?\.com/embed/|player\.vimeo\.com/video/)#"