Skip to content

Commit

Permalink
Update installation/src/Form/Rule/UsernameRule.php
Browse files Browse the repository at this point in the history
thanks @Quy

Co-Authored-By: alikon <optimus4joomla@gmail.com>
  • Loading branch information
Quy and alikon committed Feb 27, 2019
1 parent 8b40c6f commit d201af8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions installation/src/Form/Rule/UsernameRule.php
Expand Up @@ -38,6 +38,7 @@ class UsernameRule extends FormRule
public function test(\SimpleXMLElement $element, $value, $group = null, Registry $input = null, Form $form = null)
{
$filterInput = InputFilter::getInstance();

if (preg_match('#[<>"\'%;()&\\\\]|\\.\\./#', $value) || strlen(utf8_decode($value)) < 2
|| $filterInput->clean($value, 'TRIM') !== $value
|| strlen(utf8_decode($value)) > $element['size'])
Expand Down

0 comments on commit d201af8

Please sign in to comment.