Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/NunoLopes96/gsoc17_expand…
…_extension_manager into edit_updatesite
- Loading branch information
Showing
48 changed files
with
374 additions
and
341 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
administrator/components/com_associations/forms/filter_associations.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
administrator/components/com_templates/forms/filter_styles.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
administrator/components/com_templates/forms/filter_templates.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Site | ||
* @subpackage com_contact | ||
* | ||
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
namespace Joomla\Component\Contact\Site\Rule; | ||
|
||
defined('_JEXEC') or die; | ||
|
||
use Joomla\CMS\Component\ComponentHelper; | ||
use Joomla\CMS\Form\Form; | ||
use Joomla\CMS\Form\FormRule; | ||
use Joomla\Registry\Registry; | ||
use Joomla\String\StringHelper; | ||
|
||
/** | ||
* FormRule for com_contact to make sure the message body contains no banned word. | ||
* | ||
* @since 1.6 | ||
*/ | ||
class ContactEmailMessageRule extends FormRule | ||
{ | ||
/** | ||
* Method to test a message for banned words | ||
* | ||
* @param \SimpleXMLElement $element The SimpleXMLElement object representing the <field /> tag for the form field object. | ||
* @param mixed $value The form field value to validate. | ||
* @param string $group The field name group control value. This acts as an array container for the field. | ||
* For example if the field has name="foo" and the group value is set to "bar" then the | ||
* full field name would end up being "bar[foo]". | ||
* @param Registry $input An optional Registry object with the entire data set to validate against the entire form. | ||
* @param Form $form The form object for which the field is being tested. | ||
* | ||
* @return boolean True if the value is valid, false otherwise. | ||
*/ | ||
public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null) | ||
{ | ||
$params = ComponentHelper::getParams('com_contact'); | ||
$banned = $params->get('banned_text'); | ||
|
||
if ($banned) | ||
{ | ||
foreach (explode(';', $banned) as $item) | ||
{ | ||
if ($item != '' && StringHelper::stristr($value, $item) !== false) | ||
{ | ||
return false; | ||
} | ||
} | ||
} | ||
|
||
return true; | ||
} | ||
} |
Oops, something went wrong.