|
Server : Apache System : Linux s1230 5.15.0-139-generic #149~20.04.1 SMP Tue Jul 14 11:21:49 UTC 2026 x86_64 User : p141464 ( 418825) PHP Version : 7.4.33.12 Disable Function : NONE Directory : /html/relaunch-kmu/wp-content/plugins/real-cookie-banner/inc/view/blocker/ |
Upload File : |
<?php
namespace DevOwl\RealCookieBanner\view\blocker;
use DevOwl\RealCookieBanner\Vendor\DevOwl\FastHtmlTag\finder\match\AbstractMatch;
use DevOwl\RealCookieBanner\Vendor\DevOwl\FastHtmlTag\finder\match\TagAttributeMatch;
use DevOwl\RealCookieBanner\Vendor\DevOwl\HeadlessContentBlocker\AttributesHelper;
use DevOwl\RealCookieBanner\Vendor\DevOwl\HeadlessContentBlocker\BlockedResult;
use DevOwl\RealCookieBanner\Vendor\DevOwl\HeadlessContentBlocker\matcher\TagAttributeMatcher;
use DevOwl\RealCookieBanner\Vendor\DevOwl\HeadlessContentBlocker\plugins\Autoplay;
use DevOwl\RealCookieBanner\base\UtilsProvider;
// @codeCoverageIgnoreStart
\defined('ABSPATH') or die('No script kiddies please!');
// Avoid direct file request
// @codeCoverageIgnoreEnd
/**
* Enhanced `Autoplay` plugin to enable plugin and theme compatibilities.
* @internal
*/
class PluginAutoplay extends Autoplay
{
use UtilsProvider;
/**
* See `AbstractPlugin`.
*
* @param BlockedResult $result
* @param AbstractMatcher $matcher
* @param AbstractMatch $match
*/
public function blockedMatch($result, $matcher, $match)
{
if ($matcher instanceof TagAttributeMatcher) {
/**
* Var.
*
* @var TagAttributeMatch
*/
$match = $match;
$tag = $match->getTag();
$linkAttribute = $match->getLinkAttribute();
// [Theme Comp] Themify
if ($tag === 'div' && $linkAttribute === 'data-url' && $match->hasAttribute('class') && \strpos($match->getAttribute('class'), 'tb_') !== \false) {
$originalClickAttributeName = 'data-auto';
$clickAttribute = AttributesHelper::transformAttribute($originalClickAttributeName, \true);
$match->setAttribute($clickAttribute, '1');
}
}
}
}