Bug 11535: sanitize input from patron self-registration form

This patch adds the use of C4::Scrubber to the processing of input
from the patron self-registration form, thereby closing off one
avenue for Javascript injection.

To test:

[1] Use the OPAC self-registration form to enter a new patron,
    and set its address to something like:

    <span style="color: red;">BAD</span>

[2] In the staff interface, bring up the new patron record.  The
    address will show up in red, indicating a successful HTML
    injection.
[3] Apply the patch and use self-registration to enter a new
    patron with a similar case of unwanted HTML coding.
[4] Bring up the second patron in the staff interface.  This time,
    the undesirable HTML tag should not be present.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Tags are not present on testing.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Confirmed bug and that the patch fixes it.
Passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11537: Increasing test coverage for C4::Log

To test:
1. run prove t/Log.t
   Notice 1 test is run
2. apply patch
3. run prove t/Log.t
   Notice 3 tests are run

Signed-off-by: David Cook <dcook@prosentient.com.au>

Works as described.

I think there might be a typo in "Testing git log status". Should
this read "Testing get log status"? (Noticed while looking at the
code/running perl t/Log.t.)

In any case, thanks for the patch. Looks good!

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Fixed typo, thanks David

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described:
1..3
ok 1 - use C4::Log;
ok 2 - Testing GetLogStatus
ok 3 - Testing hash is non empty

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11502: make library filter in "Holds To Pull" more precise

This patch uses regex checking via the DataTables fnFilter API method
to make the branch filter more precise on the "Holds to Pull" page.

The ability to use regex is built into DataTables so this just adds
the actual expression.

_TEST PLAN_

Before applying:

1) Add library (branches) with codes of NM, NMH, and NB
2) Add items (that can be placed on hold) at all these branches
3) Place a hold on an item that is only available at NM
4) Place a hold on an item that is only available at NMH
5) Place a hold on an item that is only available at NM and NB
6) Go to "Holds to Pull" in the Circulation module
7) Filter by these three different values
8) Note that filtering by "NM" will incorrectly bring up all three
holds, while "NMH" and "NB" will only pull up one (like they should).

Apply the patch.

9) Shift+refresh the page so that your Javascript refreshes
10) Repeat step 7 (filtering by the different branch values)
11) Note that filtering by "NM" will now only bring up the hold for "NM"
and the hold for "NM" and "NB", while the others still only bring up
one hold.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11537: (follow-up) mock C4::Context::preference

This avoids turning t/Log.t into one that requires a valid
session context.

To test:

[1] Run the following and verify that the test passes.

unset KOHA_CONF
prove -v t/Log.t

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11503: [Follow-up] fix another typo

There is still a typo left to fix which I didn't catch because I was
doing a spell-check and didn't double-check the bug report:

Van der Griten -> Van der Grinten

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
bug 11542: Increase test coverage for Print.pm

to test
1. run prove t/Print.t
2. apply patch
3. run prove t/Print.t
Notice more tests are done

Signed-off-by: Roman Amor <romanwilton@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
UT passes, also passes koha-qa.pl

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tests pass :)

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11545: Increasing test coverage for Languages.pm

To test
1. Run prove t/Languages.t
2. Apply patch
2. Run prove t/Languages.t again and notice: More tests are run

Signed-off-by: alex_h <dhorsman@xtra.co.nz>
Signed-off-by: Magnus Enger <magnus@enger.priv.no>
Adds another passing test. I took th liberty of moving the test plan
from the subject to the commit message. :-)

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tests pass :)

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11545: (follow-up) move Languages.t to t/db_dependent

This patch moves t/Languages.t to t/db_dependent/Languages.t,
as the new get for getAllLanguages() works best if there's
a database available.

To test:

[1] Run prove -v t/db_dependent/Languages.t
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11539: removing 2 unused files

This patch removes C4::Barcodes::PrinterConfig, which is
used by no other code in the database.

Signed-off-by: Emma Heath <emmaheath.student@wegc.school.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
No instances of PrinterConfig found in the codebase

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Couldn't find any reference to those files in Koha.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11540: increase test coverage of Charset.pm

To test
1. run prove t/Charset.t
2. apply patch
3. run prove t/Charset.t
 notice more tests are run

Signed-off-by: Tom Houlker <thomas.houlker@hibs.school.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tests pass!

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11540: (follow-up) add a couple of tests more

This patch makes sure all scenarios are covered for SetUTF8Flag.

Signed-off-by: Emma Heath <emmaheath.student@wegc.school.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11541: increase test coverage of Installer.pm

To test
1. Run prove t/Installer.t
2. Apply patch
3. Run prove t/Installer.t
   Notice more tests are run

Signed-off-by: Francesca Moore <francescalamoore@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests pass :)

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11541: (follow-up) repair some warnings

Tests succeed, but cause many warnings:

prove t/Installer.t
t/Installer.t .. 1/9 "my" variable $self masks earlier declaration in
same scope at t/Installer.t line 19.
"my" variable $self masks earlier declaration in same scope at
t/Installer.t line 20.
"my" variable $self masks earlier declaration in same scope at
t/Installer.t line 21.
"my" variable $self masks earlier declaration in same scope at
t/Installer.t line 22.
"my" variable $self masks earlier declaration in same scope at
t/Installer.t line 23.
Odd number of elements in anonymous hash at t/Installer.t line 17.
Use of uninitialized value within @ARGV in anonymous hash ({}) at
t/Installer.t line 17.

The patch remedies that.

Test Plan:
1) Apply first patch on this bug
2) Run "prove t/Installer.t"
3) Note the warnings
4) Apply this patch
5) Repeat step 2
6) Note the warnings are gone

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11541: (follow-up) update tests

This patch updates some of the tests to more clearly
check that fields in the C4::Installer object are getting
set correctly from the context.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11541: (follow-up) move Installer.t to t/db_dependent

This test requires a valid Koha context, so this patch
moves it to t/db_dependent.

To test:

[1] Verify that prove -v t/db_dependent/Installer.t passes.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
bug 11544: increasing test coverage for Installer_PerlModules.pm

To test
1. run prove t/Installer_PerlModules.t
2. apply patch
3. run prove t/Installer_PerlModules.t
   notices more tests are run

Signed-off-by: Magnus Enger <magnus@enger.priv.no>
Adds another passing test.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tests pass :)

Signed-off-by: Galen Charlton <gmc@esilibrary.com>