CoreFiles by mySites.guru
contactemail.php32 lines, 782 bytes, from Joomla_2.5.2-Stable-Full_Package.zip
Raw History Compare with 2.5.1
md5
80fee63c63e6649d7ac6a647c7f77717
sha1
7e9ae3a93b1109468f632fd1c33b520722642476
sha256
38f1968bd736f0cbee47f805d3e558251d06502590b9a7738f784d32dc29649a
<?php
/**
 * @package		Joomla.Site
 * @subpackage	Contact
 * @copyright	Copyright (C) 2005 - 2012 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 9 releases, Joomla 2.5.0 to 2.5.8. See them all, or every version of this file.