Truncate overlong clients or versions.
Signed-off-by: Thomas Hochstein <thh@thh.name>
This commit is contained in:
parent
462f28505d
commit
ed3fb3cda0
2 changed files with 4 additions and 0 deletions
|
|
@ -500,6 +500,9 @@ sub ClientStats {
|
|||
# encode to utf-8, if necessary
|
||||
$_->{'agent'} = encode('UTF-8', $_->{'agent'}) if $_->{'agent'} =~ /[\x80-\x{ffff}]/;
|
||||
$_->{'version'} = encode('UTF-8', $_->{'version'}) if $_->{'version'} and $_->{'version'} =~ /[\x80-\x{ffff}]/;
|
||||
# truncate overlong clients or versions
|
||||
$_->{'agent'} = substr($_->{'agent'}, 0, 150) if length($_->{'agent'}) > 150;
|
||||
$_->{'version'} = substr($_->{'version'}, 0, 50) if $_->{'version'} and length($_->{'version'}) > 50;
|
||||
# special cases
|
||||
# Mozilla
|
||||
$_->{'agent'} = 'Mozilla' if $_->{'agent'} eq '•Mozilla';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue