CoreFiles by mySites.guru
ContentHelper.php38 lines, 752 bytes, from Joomla_4.2.0-beta3-Beta-Full_Package.zip
Raw History Compare with 4.2.0-beta2
md5
64baacf7f75241d16ee1ed02ffa0bec4
sha1
18ca827681976f128450e8683ec357df971ef713
sha256
52b59bd9fcf350f05f69f1359614ca73c34d9acf208efba80323d41191af9ab7
<?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;

use Joomla\CMS\Uri\Uri;

/**
 * Content api helper.
 *
 * @since  4.0.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 5 releases, Joomla 4.2.0-beta3 to 4.2.1-rc2. See them all, or every version of this file.