Seditio Source
Root |
./othercms/phpBB3/vendor/s9e/text-formatter/src/Configurator/TemplateChecks/DisallowUnsafeDynamicCSS.php
<?php

/**
* @package   s9e\TextFormatter
* @copyright Copyright (c) 2010-2021 The s9e authors
* @license   http://www.opensource.org/licenses/mit-license.php The MIT License
*/
namespace s9e\TextFormatter\Configurator\TemplateChecks;

use
DOMElement;
use
s9e\TextFormatter\Configurator\Helpers\NodeLocator;
use
s9e\TextFormatter\Configurator\Helpers\XPathHelper;
use
s9e\TextFormatter\Configurator\Items\Attribute;

class
DisallowUnsafeDynamicCSS extends AbstractDynamicContentCheck
{
   
/**
    * {@inheritdoc}
    */
   
protected function getNodes(DOMElement $template)
    {
        return
NodeLocator::getCSSNodes($template->ownerDocument);
    }

   
/**
    * {@inheritdoc}
    */
   
protected function isExpressionSafe($expr)
    {
        return
XPathHelper::isExpressionNumeric($expr);
    }

   
/**
    * {@inheritdoc}
    */
   
protected function isSafe(Attribute $attribute)
    {
        return
$attribute->isSafeInCSS();
    }
}