CoreFiles by mySites.guru
user.php41 lines, 677 bytes, from Joomla_3.9.13-Stable-Full_Package.zip
Raw History Compare with 3.9.12
md5
8b64da69daecd07a20b310976e999d66
sha1
eb9fad5504c3d75db26a78289e71885527661c47
sha256
c9cbfea047ee146bc065c00fe456a3a2c99d1461bb2675fb8d0bf6ce7df57d33
<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  Fields.User
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @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 26 releases, Joomla 3.9.2-rc to 3.9.14. See them all, or every version of this file.