CoreFiles by mySites.guru
ContentHelper.php40 lines, 729 bytes, from Joomla_4.0.0-beta2-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta
md5
31a627116cdf9c89e5b905dd818dd69c
sha1
59981cfe1ed8e4421a11a8c954180f7f9eee2ebf
sha256
cf332aceddd52725189dacb7f4c01f820965aa4bf0ef9e71f7495d31c3bf04cc
<?php
/**
 * @package     Joomla.Api
 * @subpackage  com_content
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
 * @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 4 releases, Joomla 4.0.0-beta2 to 4.0.0-beta5. See them all, or every version of this file.