CoreFiles by mySites.guru
contactemail.php32 lines, 797 bytes, from Joomla_2.5.21-Stable-Full_Package.zip
Raw History Compare with 2.5.20
md5
4ef4521adc848ce3b9d899fc0680aa6d
sha1
15afdd966c23c665d856e854c827a830eaeb3523
sha256
ef20b5b66acdc63529318fdc040dcf901a35155e92c6e4ef5740033aaca13cec
<?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($item, $value) !== false)
					return false;
		}

		return true;
	}

}

The same content is in 5 releases, Joomla 2.5.20 to 2.5.24. See them all, or every version of this file.