Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #3697: Replace \d with [0-9] in Kernel/GenericInterface. #3698

Open
wants to merge 1 commit into
base: rel-11_1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Kernel/GenericInterface/Event/Handler.pm
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ sub _ConditionCheck {
next FIELDLNAME;
}

my @ArrayFields = grep { $_ =~ m{ \A \Q$FieldName\E _ \d+ \z }xms } keys %{ $Param{Data} };
my @ArrayFields = grep { $_ =~ m{ \A \Q$FieldName\E _ [0-9]+ \z }xms } keys %{ $Param{Data} };

if ( @ArrayFields && defined $ActualCondition->{Fields}->{$FieldName}->{Match} ) {
ARRAYFIELD:
Expand Down Expand Up @@ -866,7 +866,7 @@ sub _ConditionCheck {
next FIELDLNAME;
}

my @ArrayFields = grep { $_ =~ m{ \A \Q$FieldName\E _ \d+ \z }xms } keys %{ $Param{Data} };
my @ArrayFields = grep { $_ =~ m{ \A \Q$FieldName\E _ [0-9]+ \z }xms } keys %{ $Param{Data} };

if ( @ArrayFields && defined $ActualCondition->{Fields}->{$FieldName}->{Match} ) {
ARRAYFIELD:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ sub HandleResponse {

# fix ExecutrionTime param
if ( $QueryParams{ExecutionTime} ) {
$QueryParams{ExecutionTime} =~ s{(\d+)\+(\d+)}{$1 $2};
$QueryParams{ExecutionTime} =~ s{([0-9]+)\+([0-9]+)}{$1 $2};
}

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ sub HandleResponse {

# fix ExecutrionTime param
if ( $QueryParams{ExecutionTime} ) {
$QueryParams{ExecutionTime} =~ s{(\d+)\+(\d+)}{$1 $2};
$QueryParams{ExecutionTime} =~ s{([0-9]+)\+([0-9]+)}{$1 $2};
}

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ sub AssessResponse {
$ResponseError = $ErrorMessage;
}

if ( $ResponseCode !~ m{ \A 20 \d \z }xms ) {
if ( $ResponseCode !~ m{ \A 20 [0-9] \z }xms ) {
$ResponseError = $ErrorMessage . " Response code '$ResponseCode'.";
}

Expand Down Expand Up @@ -863,7 +863,7 @@ sub HandleResponse {

# fix ExecutionTime param
if ( $QueryParams{ExecutionTime} ) {
$QueryParams{ExecutionTime} =~ s{(\d+)\+(\d+)}{$1 $2};
$QueryParams{ExecutionTime} =~ s{([0-9]+)\+([0-9]+)}{$1 $2};
}

return {
Expand All @@ -885,7 +885,7 @@ sub HandleResponse {
my $ArticleObject = $Kernel::OM->Get('Kernel::System::Ticket::Article');

# create the ticket
my ($TicketID) = $Param{Data}->{error}->{reason} =~ m/ \Q[_doc][\E (\d+) \Q]:\E \s /x; # e.g. "[_doc][5]: "
my ($TicketID) = $Param{Data}->{error}->{reason} =~ m/ \Q[_doc][\E ([0-9]+) \Q]:\E \s /x; # e.g. "[_doc][5]: "
my $Errors = 0;
if ( !$ESObject->TicketCreate( TicketID => $TicketID ) ) {
$Errors++;
Expand Down
2 changes: 1 addition & 1 deletion Kernel/GenericInterface/Invoker/Test/TestSimple.pm
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ sub HandleResponse {

# fix ExecutrionTime param
if ( $QueryParams{ExecutionTime} ) {
$QueryParams{ExecutionTime} =~ s{(\d+)\+(\d+)}{$1 $2};
$QueryParams{ExecutionTime} =~ s{([0-9]+)\+([0-9]+)}{$1 $2};
}

return {
Expand Down
4 changes: 2 additions & 2 deletions Kernel/GenericInterface/Operation/Ticket/Common.pm
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ sub ValidatePendingTime {
# if only the Diff attribute is present, check if it's a valid number and return.
# Nothing else needs to be checked in that case.
if ( keys %{ $Param{PendingTime} } == 1 && defined $Param{PendingTime}->{Diff} ) {
return if $Param{PendingTime}->{Diff} !~ m{\A \d+ \z}msx;
return if $Param{PendingTime}->{Diff} !~ m{\A [0-9]+ \z}msx;
return 1;
}
elsif ( defined $Param{PendingTime}->{Diff} ) {
Expand Down Expand Up @@ -1146,7 +1146,7 @@ sub ValidateTimeUnit {
return if !$Param{TimeUnit};

# TimeUnit must be positive
return if $Param{TimeUnit} !~ m{\A \d+([.,]\d+)? \z}xms;
return if $Param{TimeUnit} !~ m{\A [0-9]+([.,][0-9]+)? \z}xms;

return 1;
}
Expand Down
2 changes: 1 addition & 1 deletion Kernel/GenericInterface/Operation/Ticket/TicketSearch.pm
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ sub _GetDynamicFields {

# Compatibility with older versions of the web service.
for my $ParameterName ( sort keys %Param ) {
if ( $ParameterName =~ m{\A DynamicField_ ( [a-zA-Z\d\-]+ ) \z}xms ) {
if ( $ParameterName =~ m{\A DynamicField_ ( [a-zA-Z[0-9]\-]+ ) \z}xms ) {
$DynamicFieldsRaw{$1} = $Param{$ParameterName};
}
}
Expand Down
2 changes: 1 addition & 1 deletion Kernel/GenericInterface/Provider.pm
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ sub Content {
if (
$RequestURI
&&
$RequestURI =~ m{ nph-genericinterface[.]pl/ (?: WebserviceID/ (?<ID> \d+ ) | Webservice/ (?<Name> [^/?]+ ) ) }smx
$RequestURI =~ m{ nph-genericinterface[.]pl/ (?: WebserviceID/ (?<ID> [0-9]+ ) | Webservice/ (?<Name> [^/?]+ ) ) }smx
)
{
%WebserviceGetData = (
Expand Down
4 changes: 2 additions & 2 deletions Kernel/GenericInterface/Transport/HTTP/REST.pm
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ sub RequesterPerformRequest {
ErrorMessage => "'$Config->{Authentication}->{KerberosKeytab}' does not exist.",
};
}
if ( $Config->{Authentication}->{KerberosUser} =~ /[^\w\d\-\._@]/ ) {
if ( $Config->{Authentication}->{KerberosUser} =~ /[^\w[0-9]\-\._@]/ ) {
$Self->{DebuggerObject}->Error(
Summary => "Invalid user format '$Config->{Authentication}->{KerberosUser}'.",
);
Expand Down Expand Up @@ -1078,7 +1078,7 @@ sub _AssessResponse {
$ResponseError = $ErrorMessage;
}

if ( $ResponseCode !~ m{ \A 20 \d \z }xms ) {
if ( $ResponseCode !~ m{ \A 20 [0-9] \z }xms ) {
$ResponseError = $ErrorMessage . " Response code '$ResponseCode'.";
}

Expand Down