• I have an <amp-brightcove … dock> tag but even with “Video docking enabled” in Settings, I can’t make it work.

    It seems that even before ampforwp_get_setting(‘ampforwp-amp-video-docking’) is tested in features.php around line 8410, the dock attribute has already been stripped out, therefore the amp-video-docking component doesn’t get included.

    Where I can find the spot where the sanitization of the amp-brightcove element is performed and the dock attributed removed maybe because considered invalid while is not?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter DrLightman

    (@drlightman)

    I think I found the problem, in \accelerated-mobile-pages\includes\vendor\amp\includes\sanitizers\class-amp-allowed-tags-generated.php you have:

    'dock' => array(
    	'value' => '#dock-slot',
    ),

    for ‘amp-brightcove’.

    But this prevents the ability to use only dock without any value, that is one of the proper ways to use the attribute instead.

    Thread Starter DrLightman

    (@drlightman)

    If you could also check on these preg_matches in \accelerated-mobile-pages\templates\features.php:

    if(preg_match('/<amp-brightcove(.*?) dock|dock=">/', $content)){

    Something doesn’t seem right to me in the dock|dock="> part.

    Plugin Author Ahmed Kaludi

    (@ahmedkaludi)

    Can you please share URL link of your site? We will go through it and let you know back.

    Thread Starter DrLightman

    (@drlightman)

    Hello, thank you for getting back to me.

    I prefer not giving the url sorry, also you won’t find anything there becaseu I’ve already resolved by applying the modifications I exposed above.

    The first thing is that the dock attribute may be used per specs even without any value, whereas in the plugin’s class-amp-allowed-tags-generated.php is configured to accept only the ‘#dock-slot’ value, so it gets always stripped by the sanitificators.

    The second thing is the preg_match to catch and remove the attribute when one disables Video docking from plugin settings | single. It should be something more similar to this: '/<amp-brightcove(.*?) dock(?:="[^"]*")?>/', I think.

    Thread Starter DrLightman

    (@drlightman)

    FYI, in version 1.0.74 this bug is still present and I have to tweak the sources everytime

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘dock attribute stripped from amp-brightcove?’ is closed to new replies.