CoreFiles by mySites.guru
contactemail.php35 lines, 887 bytes, from Joomla_1.6.3-Stable-Full_Package.zip
Raw History Compare with 1.6.2
md5
acffceb9884548570d97f384b476179c
sha1
a0db203301cb2b5bee13c0ff01ff8c090449f26e
sha256
cd2ea20a2c6258cc0ececf3e39f94bb4e82379484f8c7c4de3f7a36a06dbc8e9
<?php
/**
 * @version		$Id: contactemail.php 20982 2011-03-17 16:12:00Z chdemko $
 * @package		Joomla.Site
 * @subpackage	Contact
 * @copyright	Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

jimport('joomla.form.formrule');

require_once 'libraries/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 (JString::stristr($item, $value) !== false)
					return false;
		}
		
		return true;
	}

}

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