CoreFiles by mySites.guru
contactemail.php32 lines, 782 bytes, from Joomla_2.5.13-Stable-Full_Package.zip
Raw History Compare with 2.5.11
md5
8a69889e2ec44023b6d3edb7a0251972
sha1
70f8102c9979b4fc19dfc09e77bf23519e644b1d
sha256
02f211353d250e48c0355a29c20e506b26ad38aec19cd2b3fd69717d0c7da7eb
<?php
/**
 * @package		Joomla.Site
 * @subpackage	Contact
 * @copyright	Copyright (C) 2005 - 2013 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 (JString::stristr($item, $value) !== false)
					return false;
		}

		return true;
	}

}

The same content is in 8 releases, Joomla 2.5.9 to 2.5.17. See them all, or every version of this file.