Bug 23329: Only redirect tracklinks.pl to urls contained in records
authorNick Clemens <nick@bywatersolutions.com>
Wed, 17 Jul 2019 11:01:01 +0000 (11:01 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 27 Nov 2019 11:30:18 +0000 (11:30 +0000)
commite11b1e6d3c1af3f36b2aa27bb75bc37e39921fe6
tree72e52b27fed93c68d2b6dddd1de74812f2c3b4a0
parentd20c9ff5882377793d311f3a7a4621c4bdc31469
Bug 23329: Only redirect tracklinks.pl to urls contained in records

Bug 19487 limited redirection to urls contained in a record/item if we were tracking.
We should probably limit forwarding if not tracking as well.
Additionally, if we don't have a soucre, let's not forward

To test:
 0 - Set TrackClicks syspref to 'Don't track'
 1 - Hit localhost:8080/cgi-bin/koha/tracklinks.pl?uri=http://www.google.com
 2 - You get forwarded to google
 3 - Set TrackClicks to 'Track anonymously'
 4 - You get a 404
 5 - Apply patch
 6 - Hit localhost:8080/cgi-bin/koha/tracklinks.pl?uri=http://www.google.com
 7 - You get a 404
 8 - Set TrackClicks syspref to 'Don't track'
 9 - Hit localhost:8080/cgi-bin/koha/tracklinks.pl?uri=http://www.google.com&biblionumber=1
     Choose a biblionumber that exists
10 - You get a 404
11 - Add http://www.google.com to the 856$u of the record used above
12 - Hit localhost:8080/cgi-bin/koha/tracklinks.pl?uri=http://www.google.com&biblionumber=1
13 - You are redirected
14 - Confirm redirection and 404 as expected with other settings of TrackClicks

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
opac/tracklinks.pl