]> git.koha-community.org Git - koha.git/commit
Bug 6253 followup: explicitly check ref value for ARRAY before casting
authorIan Walls <ian.walls@bywatersolutions.com>
Wed, 19 Oct 2011 15:46:21 +0000 (11:46 -0400)
committerChris Nighswonger <chris.nighswonger@gmail.com>
Tue, 25 Oct 2011 23:34:58 +0000 (19:34 -0400)
commitecb4cd1782384c98d9bbb931ed3b25ed5133940e
tree844cd5b9e4a10a516a9b9071543ad6c8029af792
parentecf41dd5adcf40b664414b2e2045efa387213e22
Bug 6253 followup: explicitly check ref value for ARRAY before casting

in C4::SQLHelper::_Process_Operands, $operand has been modified to be cast as an array ref
if the incoming $operand is not a ref.  However, the incoming $operand could be some other
kind of ref (hashref for example), which would case the dereferencing in line 419 to fail and exit.

Adding an explicit test for whether the ref is ARRAY seems to clear up this issue.

To test, run t/db_dependent/Members.t.  Before, it fails after test 3.  After, it completes all tests.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
(cherry picked from commit d80cf35e9ba39112bfdefc3ce6ba8ddae121347c)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
C4/SQLHelper.pm