CoreFiles by mySites.guru
url.php31 lines, 583 bytes, from Joomla_4.0.0-alpha3-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha2
md5
30904686f8f3d06506a756e99ad0d5da
sha1
c86f4c3679f06908f516872c7be9582859ce07ef
sha256
0689010b37b86bb3e7a5c61dc1ae69410218b03e48891c7d764977994eb3c0c7
<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  Fields.URL
 *
 * @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;

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 3 releases, Joomla 4.0.0-alpha3 to 4.0.0-alpha6. See them all, or every version of this file.