Skip to content

Commit

Permalink
Fixed issue with different RegEx flavour between PHP and HTML form va…
Browse files Browse the repository at this point in the history
…lidation
  • Loading branch information
christianxrow committed Sep 27, 2016
1 parent bab072a commit 91f3751
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions datatypes/xrowformgenerator/xrowformgeneratortype.php
Original file line number Diff line number Diff line change
Expand Up @@ -1350,6 +1350,14 @@ static function validate( $address )
{
$regexp = $ini->variable( "Settings", "InputEmail" );
}
else if( $ini->hasVariable( "Settings", "PHPInputEmail" ) && $ini->variable( "Settings", "PHPInputEmail" ) != '' )
{
$regexp = $ini->variable( "Settings", "PHPInputEmail" );
}
else if( $ini->hasVariable( "Settings", "PHPEmailDefaultPattern" ) && $ini->variable( "Settings", "PHPEmailDefaultPattern" ) != '' )
{
$regexp = $ini->variable( "Settings", "PHPEmailDefaultPattern" );
}
else
{
$regexp = $ini->variable( "Settings", "EmailDefaultPattern" );
Expand Down
2 changes: 2 additions & 0 deletions settings/xrowformgenerator.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ TelephoneAreaCodes=1|2[0,7]|2[1-6][0-9]|29[0-9]|3[6,9]|3[0-4]|35[0-9]|37[0-9]|38
TelephoneDefaultPattern=[1-9]{1}(?:[0-9][ |]?){4,14}[0-9]$

EmailDefaultPattern=/((([^\f\n\r\t\v\b])|([A-Za-zäöüÄÖÜ0-9_!#\$%&'\*+\-~\^`\|\{\}\.]+(\.[A-Za-zäöüÄÖÜ0-9_!#\$%&'\*+\-~/\^`\|\{\}\.]+)*))@((\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))){2,}|((([A-Za-zäöüÄÖÜ0-9\-]{1,})+\.)+[A-Za-z\-]{2,})))/
PHPEmailDefaultPattern=/((([^\f\n\r\t\v\b])|([A-Za-zäöüÄÖÜ0-9_\!\#\$\%\&\'\*\+\-\~\/\^\`\|\{\}\.]+(\.[A-Za-zäöüÄÖÜ0-9_\!\#\$\%\&\'\*\+\-\~\/\^\`\|\{\}\.]+)*))@((\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))){2,}|((([A-Za-zäöüÄÖÜ0-9\-]{1,})+\.)+[A-Za-z\-]{2,})))/

# set enabled if you would like to use a CRM like Salesforce e.g.
#UseCRM=enabled
Expand All @@ -30,6 +31,7 @@ EmailDefaultPattern=/((([^\f\n\r\t\v\b])|([A-Za-zäöüÄÖÜ0-9_!#\$%&'\*+\-~\^
#InputText=/[\w\d\s]*/
#InputNumber=/[0-9]*/
# if InputEmail is not set we take EmailDefaultPattern
#PHPInputEmail=
#InputEmail=/^[\w\d._+-]+@[\w\d._+-]{2,}\.[a-zA-Z]{2,}*/
#*** InputTelephone is as default from TelephoneNumberPattern oder TelephoneDefaultPattern ****
#*** InputPassword is also static in xrowformgenerator_frontend.js: must be at least 8 characters long and two of these conditions: one special character, a number and/or a capital letter
Expand Down

0 comments on commit 91f3751

Please sign in to comment.