CoreFiles by mySites.guru
user.php41 lines, 677 bytes, from Joomla_3.8.13-Stable-Full_Package.zip
Raw History Compare with 3.8.12
md5
bae1d2d2631a39c956a320cbe45bb094
sha1
e7483478800d6937e36eaf09742ebfcfe15cae61
sha256
db9e8bab4282c0765c3bc55b7a0ed9dbb000cdaf27ee2b8f2d9420d4c7474cd7
<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  Fields.User
 *
 * @copyright   Copyright (C) 2005 - 2018 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 29 releases, Joomla 3.8.4-rc to 3.9.1. See them all, or every version of this file.