Stop unnecessary warnings in get_language
authorColin Campbell <colin.campbell@ptfs-europe.com>
Mon, 2 Apr 2012 14:06:28 +0000 (15:06 +0100)
committerPaul Poulain <paul.poulain@biblibre.com>
Wed, 4 Apr 2012 16:33:11 +0000 (18:33 +0200)
commitce046f9a732a74a7b6a5ddca228d2579c08d288d
tree0adf8e110d67d0f942ddc4eaf7ee663011dff5e5
parent2bc542789fdf9d551a408bc8349daa062a37c496
Stop unnecessary warnings in get_language

Refactor code to be more idiomatic and clarify its intention was testing
undef against languages causing log warn was creating and assigning to
unnecessary variables calling accept_language with an undef is an
expensive way to get undef returned to the caller test we are asking it
a meabingful question use any rather than first ( we dont care about
firstness it should be unique anyway but it obscures the meaning of the
test ) split takes a pattern not a string

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Having put my hands recently in this part of Koha code, I can confirm
that this patch fix log warnings, and add clarity and conciseness.

http://bugs.koha-community.org/show_bug.cgi?id=7874
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
C4/Templates.pm