Commit e41be10a authored by Christophe Maudoux's avatar Christophe Maudoux

Improve RegExp (#1629)

parent fcac69fe
......@@ -120,7 +120,7 @@ sub defaultValues {
'logoutServices' => {},
'macros' => {},
'mail2fActivation' => 0,
'mail2fCodeRegex' => '\\d\\d\\d\\d\\d\\d',
'mail2fCodeRegex' => '\\d{6}',
'mailCharset' => 'utf-8',
'mailFrom' => 'noreply@example.com',
'mailSessionKey' => 'mail',
......
......@@ -1573,7 +1573,7 @@ qr/^(?:\*\.)?(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][
'type' => 'longtext'
},
'mail2fCodeRegex' => {
'default' => '\\d\\d\\d\\d\\d\\d',
'default' => '\\d{6}',
'type' => 'pcre'
},
'mail2fLogo' => {
......@@ -3095,19 +3095,19 @@ qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.]
'default' => 0,
'select' => [
{
'k' => 0,
'k' => '0',
'v' => 'unsecuredCookie'
},
{
'k' => 1,
'k' => '1',
'v' => 'securedCookie'
},
{
'k' => 2,
'k' => '2',
'v' => 'doubleCookie'
},
{
'k' => 3,
'k' => '3',
'v' => 'doubleCookieForSingleSession'
}
],
......
......@@ -1319,7 +1319,7 @@ sub attributes {
},
mail2fCodeRegex => {
type => 'pcre',
default => '\d\d\d\d\d\d',
default => '\d{6}',
documentation => 'Regular expression to create a mail OTP code',
},
mail2fTimeout => {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -44,7 +44,7 @@ qr%<input name="code" value="" class="form-control" id="extcode" trplaceholder="
) or print STDERR Dumper( $res->[2]->[0] );
count(1);
ok( mail() =~ m%<b>(\d\d\d\d)</b>%, 'Found 2F code in mail' )
ok( mail() =~ m%<b>(\d{4})</b>%, 'Found 2F code in mail' )
or print STDERR Dumper( mail() );
my $code = $1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment