CoreFiles by mySites.guru
contactemail.php32 lines, 797 bytes, from Joomla_2.5.28-Stable-Full_Package.zip
Raw History Compare with 2.5.27
md5
e45f88bb10a42a088e33bdc10f1f43c9
sha1
245778bd5caf453507787ae3bd48d1945ea630d2
sha256
a0c37f5f313c864268b54617314bc7c24fe7793d95acdee65f84a16f285a63d8
<?php
/**
 * @package		Joomla.Site
 * @subpackage	Contact
 * @copyright	Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

require_once JPATH_PLATFORM. '/joomla/form/rules/email.php';

class JFormRuleContactEmail extends JFormRuleEmail
{
	public function test(& $element, $value, $group = null, & $input = null, & $form = null)
	{
		if(!parent::test($element, $value, $group, $input, $form)){
			return false;
		}

		$params = JComponentHelper::getParams('com_contact');
		$banned = $params->get('banned_email');

		foreach(explode(';', $banned) as $item){
			if ($item != '' && JString::stristr($value, $item) !== false)
					return false;
		}

		return true;
	}

}

The same content is in 4 releases, Joomla 2.5.25 to 2.5.28. See them all, or every version of this file.