CoreFiles by mySites.guru
Configuration.php44 lines, 944 bytes, from Joomla_4.2.5-Stable-Full_Package.zip
Raw History Compare with 4.2.4
md5
618e9daff96fcb582b02a6c7e7006abd
sha1
7b3ecaebfc0ad458eaac1fe9a0e34bebd34220bf
sha256
16eb1665dc8b358f8bd71db1356edbb15a1a468d61ba1774a63adbd98e36c47f
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_admin
 *
 * @copyright   (C) 2020 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Component\Admin\Administrator\Service\HTML;

\defined('_JEXEC') or die;

/**
 * Class for rendering configuration values
 *
 * @since  4.0.0
 */
class Configuration
{
    /**
     * Method to generate a string for a value
     *
     * @param   mixed  $value  The configuration value
     *
     * @return  string  Formatted and escaped string
     *
     * @since  4.0.0
     */
    public function value($value): string
    {
        if (\is_bool($value))
        {
            return $value ? 'true' : 'false';
        }

        if (\is_array($value))
        {
            $value = implode(', ', $value);
        }

        return htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
    }
}

The same content is in 11 releases, Joomla 4.2.5 to 4.3.0-alpha3. See them all, or every version of this file.