KumbiaPHP/KumbiaPHP

View on GitHub
core/libs/filter/base_filter/htmlentities_filter.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php
/**
 * KumbiaPHP web & app Framework
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.
 *
 * @category   Kumbia
 * @package    Filter
 * @subpackage BaseFilter
 *
 * @copyright  Copyright (c) 2005 - 2023 KumbiaPHP Team (http://www.kumbiaphp.com)
 * @license    https://github.com/KumbiaPHP/KumbiaPHP/blob/master/LICENSE   New BSD License
 */

/**
 * Filtra una cadena Htmlentities
 *
 * @category   Kumbia
 * @package    Filter
 * @subpackage BaseFilter
 */
class HtmlentitiesFilter implements FilterInterface
{

    /**
     * Ejecuta el filtro
     *
     * @param string $s
     * @param array $options
     * @return string
     */
    public static function execute($s, $options)
    {
        return htmlentities((string) $s, ENT_QUOTES, $options['charset'] ?? APP_CHARSET);
    }

}