CoreFiles by mySites.guru
BannerHelper.php39 lines, 843 bytes, from Joomla_4.2.1-rc2-Release_Candidate-Full_Package.zip
Raw History Compare with 4.2.1-rc1
md5
73641bfab0049d63fe3049d4a8079071
sha1
9307296cd63e4ff702da147842df8b5341dcbd89
sha256
ce436419a2fd97bc4b19f2399aa96da41a0127decde8c43d6fa88032ab2f7638
<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_banners
 *
 * @copyright   (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Component\Banners\Site\Helper;

/**
 * Banner Helper Class
 *
 * @since  1.6
 */
abstract class BannerHelper
{
    /**
     * Checks if a URL is an image
     *
     * @param   string  $url  The URL path to the potential image
     *
     * @return  boolean  True if an image of type bmp, gif, jp(e)g, png or webp, false otherwise
     *
     * @since   1.6
     */
    public static function isImage($url)
    {
        $urlCheck = explode('?', $url);

        if (preg_match('#\.(?:bmp|gif|jpe?g|png|webp)$#i', $urlCheck[0])) {
            return true;
        }

        return false;
    }
}

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.