CoreFiles by mySites.guru
user.php41 lines, 664 bytes, from Joomla_3.10.12-Stable-Full_Package.zip
Raw History Compare with 3.10.11
md5
ea03808eed92f7229c6bfcffe183998f
sha1
af268ca785d54db2f91ee981759cb9c7b5036d6b
sha256
be5b9efad64c339eef20a1dfa600c883ed54d9fc1514d368b7c197f7a8429589
<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  Fields.User
 *
 * @copyright   (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
defined('_JEXEC') or die;

$value = $field->value;

if ($value == '')
{
	return;
}

$value = (array) $value;
$texts = array();

foreach ($value as $userId)
{
	if (!$userId)
	{
		continue;
	}

	$user = JFactory::getUser($userId);

	if ($user)
	{
		// Use the Username
		$texts[] = $user->name;
		continue;
	}

	// Fallback and add the User ID if we get no JUser Object
	$texts[] = $userId;
}

echo htmlentities(implode(', ', $texts));

The same content is in 25 releases, Joomla 3.10.0-alpha2 to 3.10.12. See them all, or every version of this file.