Bugzilla – Attachment 41026 Details for
Bug 14530
856$u URL checker ( check-url.pl ) complains about ftp based URLs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14530 - 856$u URL checker ( check-url.pl ) complains about ftp based URLs
Bug-14530---856u-URL-checker--check-urlpl--complai.patch (text/plain), 2.17 KB, created by
Kyle M Hall (khall)
on 2015-07-16 13:39:24 UTC
(
hide
)
Description:
Bug 14530 - 856$u URL checker ( check-url.pl ) complains about ftp based URLs
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-07-16 13:39:24 UTC
Size:
2.17 KB
patch
obsolete
>From a732f3040bfcbfdc7c49f66e37f5688b51df3936 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 16 Jul 2015 09:16:46 -0400 >Subject: [PATCH] Bug 14530 - 856$u URL checker ( check-url.pl ) complains about ftp based URLs > >The script check-url.pl assumes that any URL not prefixed with http must >be a relative URL. This is problematic as the URL could be prefixed with >ftp as well. > >Any 856$u using an ftp url is given the error "400 URL Must be >absolute". > >Since HTTP::Request cannot handle ftp urls, we should just skip them. > >I also noticed that check-url-quick.pl checks for prefixes with >case insensitivity. That seems like a good idea so I've added >that to check-url.pl > >Test Plan: >1) Apply this patch >2) Find or create a record with an ftp url in 865$u >3) Run check-url.pl >4) Note the ftp url is skipped >5) Run check-url-quick.pl >6) Note the ftp url is skipped >--- > misc/cronjobs/check-url-quick.pl | 1 + > misc/cronjobs/check-url.pl | 4 +++- > 2 files changed, 4 insertions(+), 1 deletions(-) > >diff --git a/misc/cronjobs/check-url-quick.pl b/misc/cronjobs/check-url-quick.pl >index e599808..7671166 100755 >--- a/misc/cronjobs/check-url-quick.pl >+++ b/misc/cronjobs/check-url-quick.pl >@@ -95,6 +95,7 @@ sub check_all_url { > foreach my $field ( $record->field($tag) ) { > my $url = $field->subfield('u'); > next unless $url; >+ next if $url =~ /^ftp/i; > $url = "$host/$url" unless $url =~ /^http/i; > $count++; > http_request( >diff --git a/misc/cronjobs/check-url.pl b/misc/cronjobs/check-url.pl >index 71885ab..064ad17 100755 >--- a/misc/cronjobs/check-url.pl >+++ b/misc/cronjobs/check-url.pl >@@ -112,7 +112,9 @@ sub check_biblio { > foreach my $field ( $record->field('856') ) { > my $url = $field->subfield('u'); > next unless $url; >- $url = "$host/$url" unless $url =~ /^http/; >+ next if $url =~ /^ftp/i; >+ >+ $url = "$host/$url" unless $url =~ /^http/i; > my $check = { url => $url }; > if ( $bad_url->{ $url } ) { > $check->{ is_success } = 1; >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14530
: 41026