Skip to content

Commit 04fa829

Browse files
author
seth
committedApr 1, 2017
bugfix: too much slashes
1 parent 510ba37 commit 04fa829

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎google_url_converter.cgi

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,24 @@ sub process_form{
3636
my $url = $cgi->param('url');
3737
my $return_success = 0;
3838
# google cache
39-
if($url=~/https?:\/\/webcache\.googleusercontent\.com\/search\?q=cache:[a-zA-Z0-9_-]{12}:([^+ ]+)/){
39+
if($url =~ /https?:\/\/webcache\.googleusercontent\.com\/search\?q=cache:[a-zA-Z0-9_-]{12}:([^+ ]+)/){
4040
$url = $1;
4141
$url = 'http://'.$url unless $url =~ /^(?:https?|ftp):\/\//;
4242
print "<div>".naive_html_encode(uri_unescape($url))."</div>\n";
4343
$return_success = 1;
4444
# google redirects
45-
}elsif($url=~/[?&](?:img)?url=([^&]+)/ or $url=~/google\.[a-z]+\/url\?.*\bq=(https?:[^&]+)/){
45+
}elsif($url =~ /[?&](?:img)?url=([^&]+)/ or $url=~/google\.[a-z]+\/url\?.*\bq=(https?:[^&]+)/){
4646
$url = $1;
4747
print "<div>".naive_html_encode(uri_unescape($url))."</div>\n";
4848
#print "<div>".uri_decode($url)."</div>\n";
4949
$return_success = 1;
5050
# facebook redirects
51-
}elsif($url=~/^https?:\/\/[a-z0-9-.]*facebook\..*[?&]u=(http[^&]+)//){
51+
}elsif($url =~ /^https?:\/\/[a-z0-9-.]*facebook\..*[?&]u=(http[^&]+)/){
5252
$url = $1;
5353
print "<div>".naive_html_encode(uri_unescape($url))."</div>\n";
5454
$return_success = 1;
5555
# archive.today
56-
}elsif($url=~/https?:\/\/(?:www\.)?archive\.(?:today|is)\/[a-zA-Z0-9_]+(?:#.*)?$/){
56+
}elsif($url =~ /https?:\/\/(?:www\.)?archive\.(?:today|is)\/[a-zA-Z0-9_]+(?:#.*)?$/){
5757
my $ua = LWP::UserAgent->new('agent' => 'Mozilla/5.0');
5858
my $response = $ua->get($url);
5959
if($response->is_success){

0 commit comments

Comments
 (0)