mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 13:21:28 +00:00
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.
This commit is contained in:
parent
f5ec789f5f
commit
8ffd16f0b1
@ -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