CoreFiles by mySites.guru
Configuration.php44 lines, 848 bytes, from Joomla_4.0.3-Stable-Full_Package.zip
Raw History Compare with 4.0.2
md5
a67b9255606aa7f5b5cc664f8a74c437
sha1
6a6e3ec16b14504cee12af56885e94b2aae696da
sha256
ef88b1b95f3589f4cc0248cde16c7c4a0cf6fa1a145df5ac847ac164f36deaff
<?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 62 releases, Joomla 4.0.0-beta6 to 4.2.5-rc1. See them all, or every version of this file.