summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-05-23 08:35:27 +0200
committerAleksander Machniak <alec@alec.pl>2012-05-23 20:06:29 +0200
commitda19e0ee7c5656feb49553c398fdb94e3f618c26 (patch)
tree212b4e0c9a273b27d65e1566459161b3d52ed4fd
parent6e7299422217fe543c113ffb1fc9cdbe24d95d31 (diff)
Fix possible PHP warning in in_array_nocase() when 2nd argument is not an array
Conflicts: program/include/rcube_shared.inc
-rw-r--r--program/include/rcube_shared.inc8
1 files changed, 5 insertions, 3 deletions
diff --git a/program/include/rcube_shared.inc b/program/include/rcube_shared.inc
index ab4b77bae..8f5f0739a 100644
--- a/program/include/rcube_shared.inc
+++ b/program/include/rcube_shared.inc
@@ -82,9 +82,11 @@ function send_future_expire_header($offset=2600000)
function in_array_nocase($needle, $haystack)
{
$needle = mb_strtolower($needle);
- foreach ($haystack as $value)
- if ($needle===mb_strtolower($value))
- return true;
+ foreach ((array)$haystack as $value) {
+ if ($needle === mb_strtolower($value)) {
+ return true;
+ }
+ }
return false;
}