Bugzilla – Attachment 75230 Details for
Bug 20737
Use https for Baker and Taylor cover images
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20737: Use https for baker and taylor cover images
Bug-20737-Use-https-for-baker-and-taylor-cover-ima.patch (text/plain), 4.25 KB, created by
Katrin Fischer
on 2018-05-10 15:57:35 UTC
(
hide
)
Description:
Bug 20737: Use https for baker and taylor cover images
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2018-05-10 15:57:35 UTC
Size:
4.25 KB
patch
obsolete
>From 96db4da7bfe1c925c282a40be58a79ae235805c1 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 9 May 2018 11:51:20 +0000 >Subject: [PATCH] Bug 20737: Use https for baker and taylor cover images > >Easy change, should be able to verify with code review or testing with >dummy values > >To test: >1 - Put some values in baker and taylor prefs (don't need to be valid) >2 - Do a search on the opac (and have some items with isbns) >3 - Inspect the cover images links to ensure they are formed correctly >4 - prove -v t/External/BakerTaylor.t > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > C4/External/BakerTaylor.pm | 6 +++--- > opac/opac-detail.pl | 2 +- > t/External/BakerTaylor.t | 4 ++-- > 3 files changed, 6 insertions(+), 6 deletions(-) > >diff --git a/C4/External/BakerTaylor.pm b/C4/External/BakerTaylor.pm >index 99d4dd5..e5f5c7b 100644 >--- a/C4/External/BakerTaylor.pm >+++ b/C4/External/BakerTaylor.pm >@@ -44,7 +44,7 @@ sub _initialize { > $user = (@_ ? shift : C4::Context->preference('BakerTaylorUsername') ) || ''; # LL17984 > $pass = (@_ ? shift : C4::Context->preference('BakerTaylorPassword') ) || ''; # CC82349 > $link_url = (@_ ? shift : C4::Context->preference('BakerTaylorBookstoreURL')); >- $image_url = "http://contentcafe2.btol.com/ContentCafe/Jacket.aspx?UserID=$user&Password=$pass&Options=Y&Return=T&Type=S&Value="; >+ $image_url = "https://contentcafe2.btol.com/ContentCafe/Jacket.aspx?UserID=$user&Password=$pass&Options=Y&Return=T&Type=S&Value="; > $agent = "Koha/$VERSION [en] (Linux)"; > #"Mozilla/4.76 [en] (Win98; U)", # if for some reason you want to go stealth, you might prefer this > } >@@ -70,7 +70,7 @@ sub content_cafe_url { > ($user and $pass) or return; > my $isbn = (@_ ? shift : ''); > $isbn =~ s/(p|-)//g; # sanitize >- return "http://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=$user&Password=$pass&Options=Y&ItemKey=$isbn"; >+ return "https://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=$user&Password=$pass&Options=Y&ItemKey=$isbn"; > } > > sub http_jacket_link { >@@ -90,7 +90,7 @@ sub availability { > my $isbn = shift or return; > ($user and $pass) or return; > $isbn =~ s/(p|-)//g; # sanitize >- my $url = "http://contentcafe2.btol.com/ContentCafe/InventoryAvailability.asmx/CheckInventory?UserID=$user&Password=$pass&Value=$isbn"; >+ my $url = "https://contentcafe2.btol.com/ContentCafe/InventoryAvailability.asmx/CheckInventory?UserID=$user&Password=$pass&Value=$isbn"; > $debug and warn __PACKAGE__ . " request:\n$url\n"; > my $content = get($url); > $debug and print STDERR $content, "\n"; >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 1fad0ab..4ae28ec 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -1081,7 +1081,7 @@ if (C4::Context->preference("BakerTaylorEnabled")) { > { > $template->param( > BakerTaylorContentURL => >- sprintf("http://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=%s&Password=%s&ItemKey=%s&Options=Y", >+ sprintf("https://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=%s&Password=%s&ItemKey=%s&Options=Y", > $bt_user,$bt_pass,$isbn) > ); > } >diff --git a/t/External/BakerTaylor.t b/t/External/BakerTaylor.t >index cbaa56e..f6ceb2a 100755 >--- a/t/External/BakerTaylor.t >+++ b/t/External/BakerTaylor.t >@@ -20,8 +20,8 @@ t::lib::Mocks::mock_preference( 'BakerTaylorUsername', $username ); > t::lib::Mocks::mock_preference( 'BakerTaylorPassword', $password ); > t::lib::Mocks::mock_preference( 'BakerTaylorBookstoreURL', $link_url ); > >-my $image_url = "http://contentcafe2.btol.com/ContentCafe/Jacket.aspx?UserID=$username&Password=$password&Options=Y&Return=T&Type=S&Value="; >-my $content_cafe = "http://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=$username&Password=$password&Options=Y&ItemKey="; >+my $image_url = "https://contentcafe2.btol.com/ContentCafe/Jacket.aspx?UserID=$username&Password=$password&Options=Y&Return=T&Type=S&Value="; >+my $content_cafe = "https://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=$username&Password=$password&Options=Y&ItemKey="; > > is( C4::External::BakerTaylor::image_url(), $image_url, "testing default image url"); > is( C4::External::BakerTaylor::image_url("aa"), $image_url."aa", "testing image url construction"); >-- >2.1.4
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 20737
:
75204
|
75230
|
75250