CoreFiles by mySites.guru
url.php31 lines, 583 bytes, from Joomla_4.0.0-alpha8-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha7
md5
540887c8beb0f972901e491d3b07f5d5
sha1
29496856cffb7893f8d01edd6aebe94f45cb80cf
sha256
3a0ac4b53a432021b396c0134f77b6806442ddbdfd374ad69dadfa4bb450d464
<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  Fields.URL
 *
 * @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;

use Joomla\CMS\Uri\Uri;

$value = $field->value;

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

$attributes = '';

if (!Uri::isInternal($value))
{
	$attributes = ' rel="nofollow noopener noreferrer" target="_blank"';
}

echo sprintf('<a href="%s"%s>%s</a>',
	htmlspecialchars($value),
	$attributes,
	htmlspecialchars($value)
);

The same content is in 6 releases, Joomla 4.0.0-alpha7 to 4.0.0-alpha12. See them all, or every version of this file.