Bugzilla – Attachment 71745 Details for
Bug 20218
Tracklinks fails when URL has special characters
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20218: Fix matching of uri in tracklinks
Bug-20218-Fix-matching-of-uri-in-tracklinks.patch (text/plain), 1.31 KB, created by
Nick Clemens (kidclamp)
on 2018-02-16 12:49:28 UTC
(
hide
)
Description:
Bug 20218: Fix matching of uri in tracklinks
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2018-02-16 12:49:28 UTC
Size:
1.31 KB
patch
obsolete
>From da3e591ce28b0d5fdae810f700de6bbfe0faf9f5 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 16 Feb 2018 12:31:39 +0000 >Subject: [PATCH] Bug 20218: Fix matching of uri in tracklinks > >The current code matches using a regex, this breaks when the url >contains special characters. We swtich it to equality check > >To test: >1 - Enable TrackClicks (either track or anonymous) >2 - Find the URL of a biblio in the OPAC >3 - Paste this into the 856$u of another record > (or use any url containing a '?' or other characters) >4 - View the record in the opac >5 - Click the URL >6 - 404 Error! >7 - Apply patch >8 - Try again >9 - Success! >--- > opac/tracklinks.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/opac/tracklinks.pl b/opac/tracklinks.pl >index 48076cf..b5743fe 100755 >--- a/opac/tracklinks.pl >+++ b/opac/tracklinks.pl >@@ -57,7 +57,7 @@ if ($uri) { > > my $record = C4::Biblio::GetMarcBiblio({ biblionumber => $biblionumber }); > my $marc_urls = C4::Biblio::GetMarcUrls($record, C4::Context->preference('marcflavour')); >- if ( grep { /^$uri$/ } map { $_->{MARCURL} } @$marc_urls ) { >+ if ( grep { $_ eq $uri } map { $_->{MARCURL} } @$marc_urls ) { > $tracker->trackclick( > { > uri => $uri, >-- >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 20218
:
71745
|
72215
|
72246