From: djmcgrath Date: Sun, 25 Jan 2009 04:27:16 +0000 (+0000) Subject: * Google module should now return a URI as is, without converting chars that could... X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=53500844dd76ee29cb80e438f61a19101f8efc51;p=infobot.git * Google module should now return a URI as is, without converting chars that could break urls for some sites (ie: %3F vs. ?) git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@1863 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/src/Modules/Google.pl b/src/Modules/Google.pl index a8a66f9..41187a6 100644 --- a/src/Modules/Google.pl +++ b/src/Modules/Google.pl @@ -51,9 +51,14 @@ sub GoogleSearch { $retval = "$where says \"\002$what\002\" is at "; foreach my $r (@results) { my $url = $r->url; + + # Returns a string with each %XX sequence replaced with the actual byte + # (octet). From URI::Escape uri_unescape() + $url =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg; + $retval .= " \002or\002 " if ( $count > 0 ); $retval .= $url; - last if ++$count >= $maxshow; + last if ++$count >= $maxshow; # Only seems to return max of 4? } &::performStrictReply($retval);