CoreFiles by mySites.guru
ContentHelper.php40 lines, 716 bytes, from Joomla_4.0.0-beta6-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta5
md5
35a41603c6f41fa243b3dd9244198711
sha1
a83c5ed02ca8da4f9e7d2de53f140528df0770ab
sha256
f2bda062df9febde4c8962a43bb50703e88f2f3056f900d850b80abd264d6f62
<?php
/**
 * @package     Joomla.Api
 * @subpackage  com_content
 *
 * @copyright   (C) 2020 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Component\Content\Api\Helper;

\defined('_JEXEC') or die;

use Joomla\CMS\Uri\Uri;

/**
 * Content api helper.
 *
 * @since  4.0
 */
class ContentHelper
{
	/**
	 * Fully Qualified Domain name for the image url
	 *
	 * @param   string  $uri      The uri to resolve
	 *
	 * @return  string
	 */
	public static function resolve(string $uri): string
	{
		// Check if external URL.
		if (stripos($uri, 'http') !== 0)
		{
			return Uri::root() . $uri;
		}

		return $uri;
	}
}

The same content is in 2 releases, Joomla 4.0.0-beta6 to 4.0.0-beta7. See them all, or every version of this file.