Lines 21-26
Link Here
|
21 |
use Modern::Perl; |
21 |
use Modern::Perl; |
22 |
use C4::Context; |
22 |
use C4::Context; |
23 |
use C4::Auth qw(checkauth); |
23 |
use C4::Auth qw(checkauth); |
|
|
24 |
use C4::Biblio; |
24 |
use Koha::Linktracker; |
25 |
use Koha::Linktracker; |
25 |
use CGI qw ( -utf8 ); |
26 |
use CGI qw ( -utf8 ); |
26 |
|
27 |
|
Lines 54-78
if ($uri) {
Link Here
|
54 |
my $biblionumber = $cgi->param('biblionumber') || 0; |
55 |
my $biblionumber = $cgi->param('biblionumber') || 0; |
55 |
my $itemnumber = $cgi->param('itemnumber') || 0; |
56 |
my $itemnumber = $cgi->param('itemnumber') || 0; |
56 |
|
57 |
|
57 |
$tracker->trackclick( |
58 |
my $record = C4::Biblio::GetMarcBiblio({ biblionumber => $biblionumber }); |
58 |
{ |
59 |
my $marc_urls = C4::Biblio::GetMarcUrls($record, C4::Context->preference('marcflavour')); |
59 |
uri => $uri, |
60 |
if ( grep { /^$uri$/ } map { $_->{MARCURL} } @$marc_urls ) { |
60 |
biblionumber => $biblionumber, |
61 |
$tracker->trackclick( |
61 |
borrowernumber => $borrowernumber, |
62 |
{ |
62 |
itemnumber => $itemnumber |
63 |
uri => $uri, |
63 |
} |
64 |
biblionumber => $biblionumber, |
64 |
); |
65 |
borrowernumber => $borrowernumber, |
65 |
print $cgi->redirect($uri); |
66 |
itemnumber => $itemnumber |
|
|
67 |
} |
68 |
); |
69 |
print $cgi->redirect($uri); |
70 |
exit; |
71 |
} |
66 |
} |
72 |
} |
67 |
else { |
73 |
else { |
68 |
|
74 |
|
69 |
# We have a valid url, but we shouldn't track it, just redirect |
75 |
# We have a valid url, but we shouldn't track it, just redirect |
70 |
print $cgi->redirect($uri); |
76 |
print $cgi->redirect($uri); |
|
|
77 |
exit; |
71 |
} |
78 |
} |
72 |
} |
79 |
} |
73 |
else { |
|
|
74 |
|
80 |
|
75 |
# we shouldn't be here, bail out |
81 |
print $cgi->redirect("/cgi-bin/koha/errors/404.pl"); # escape early |
76 |
print $cgi->redirect("/cgi-bin/koha/errors/404.pl"); # escape early |
82 |
exit; |
77 |
exit; |
|
|
78 |
} |
79 |
- |
|
|