CoreFiles by mySites.guru
BannerHelper.php41 lines, 803 bytes, from Joomla_4.2.0-beta2-Beta-Full_Package.zip
Raw History Compare with 4.2.0-beta1
md5
10c7a76855bd64fae3a2012c84f2478a
sha1
39e5a3bcef2a09e9c43840974c719e13908fd686
sha256
dcc5d2f76aa298ac1fd8d1dab81989f86d5b40a35045374a4eea198b472cd98c
<?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;

\defined('_JEXEC') or die;

/**
 * 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 49 releases, Joomla 4.0.0-rc1 to 4.2.0-beta2. See them all, or every version of this file.