From: eldy <> Date: Sat, 14 Aug 2004 14:50:15 +0000 (+0000) Subject: Increase speed by not capturing not required regex X-Git-Tag: AWSTATS_6_3_RELEASE~111 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c857ffcacabf1b57a9e8e6d6ed15bef33b4fba2f;p=thirdparty%2FAWStats.git Increase speed by not capturing not required regex --- diff --git a/wwwroot/cgi-bin/plugins/decodeutfkeys.pm b/wwwroot/cgi-bin/plugins/decodeutfkeys.pm index 51f060cb..1cecd1c2 100644 --- a/wwwroot/cgi-bin/plugins/decodeutfkeys.pm +++ b/wwwroot/cgi-bin/plugins/decodeutfkeys.pm @@ -63,7 +63,7 @@ sub DecodeKey_decodeutfkeys { if (! $encoding) { error("Function DecodeKey from plugin decodeutfkeys was called but AWStats don't know language code required to output new value."); } $string =~ s/\\x(\w\w)/%$1/gi; # Change "\xc4\xbe\xd7\xd3\xc3\xc0" into "%c4%be%d7%d3%c3%c0" $string=URI::Escape::uri_unescape($string); - if ( $string =~ m/^([\x00-\x7f]|[\xc2-\xdf][\x80-\xbf]|\xe0[\xa0-\xbf][\x80-\xbf]|[\xe1-\xef][\x80-\xbf][\x80-\xbf]|\xf0[\x90-\xbf][\x80-\xbf][\x80-\xbf]|[\xf1-\xf7][\x80-\xbf][\x80-\xbf][\x80-\xbf])*$/ ) + if ( $string =~ m/^(?:[\x00-\x7f]|[\xc2-\xdf][\x80-\xbf]|\xe0[\xa0-\xbf][\x80-\xbf]|[\xe1-\xef][\x80-\xbf][\x80-\xbf]|\xf0[\x90-\xbf][\x80-\xbf][\x80-\xbf]|[\xf1-\xf7][\x80-\xbf][\x80-\xbf][\x80-\xbf])*$/ ) { $string=Encode::encode($encoding, Encode::decode("utf-8", $string)); } diff --git a/wwwroot/cgi-bin/plugins/hostinfo.pm b/wwwroot/cgi-bin/plugins/hostinfo.pm index 96c9db9c..7c266573 100644 --- a/wwwroot/cgi-bin/plugins/hostinfo.pm +++ b/wwwroot/cgi-bin/plugins/hostinfo.pm @@ -112,7 +112,7 @@ sub ShowInfoHost_hostinfo { $linkforwhois=2; } else { # Hostname - $param =~ /([-\w]+\.[-\w]+\.(au|uk|jp|nz))$/ or $param =~ /([-\w]+\.[-\w]+)$/; + $param =~ /([-\w]+\.[-\w]+\.(?:au|uk|jp|nz))$/ or $param =~ /([-\w]+\.[-\w]+)$/; $keyforwhois=$1; $linkforwhois=1; }