Add some null checking -- if the string is undefined, then turn it into the empty string. This avoids many undefined value warnings when the data provided by the user is incomplete.
git-svn-id: svn://10.0.0.236/trunk@122182 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
f641659fa9
commit
cbbeb386bf
@ -73,13 +73,17 @@ sub splitArguments {
|
||||
my $value = $2;
|
||||
# decode the strings
|
||||
foreach my $string ($name, $value) {
|
||||
$string =~ tr/+/ /; # convert + to spaces
|
||||
$string =~ s/% # a percent symbol
|
||||
( # followed by
|
||||
[0-9A-Fa-f]{2} # 2 hexidecimal characters
|
||||
) # which we shall put in $1
|
||||
/chr(hex($1)) # and convert back into a character
|
||||
/egox; # (evaluate, globally, optimised, with comments)
|
||||
if (defined($string)) {
|
||||
$string =~ tr/+/ /; # convert + to spaces
|
||||
$string =~ s/% # a percent symbol
|
||||
( # followed by
|
||||
[0-9A-Fa-f]{2} # 2 hexidecimal characters
|
||||
) # which we shall put in $1
|
||||
/chr(hex($1)) # and convert back into a character
|
||||
/egox; # (evaluate, globally, optimised, with comments)
|
||||
} else {
|
||||
$string = '';
|
||||
}
|
||||
}
|
||||
$self->addArgument($name, $value);
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user