From 38066281b27728cf9ec8641f0a69fa923c4f093c Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Fri, 04 Sep 2009 13:25:57 -0400
Subject: [PATCH] - make sure 'required_fields' is an array (#1485892)

---
 program/include/rcube_ldap.php |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/program/include/rcube_ldap.php b/program/include/rcube_ldap.php
index 016509c..9854ac0 100644
--- a/program/include/rcube_ldap.php
+++ b/program/include/rcube_ldap.php
@@ -57,6 +57,10 @@
       if (preg_match('/^(.+)_field$/', $prop, $matches))
         $this->fieldmap[$matches[1]] = $this->_attr_name(strtolower($value));
 
+    // make sure 'required_fields' is an array
+    if (!is_array($this->prop['required_fields']))
+      $this->prop['required_fields'] = (array) $this->prop['required_fields'];
+
     foreach ($this->prop['required_fields'] as $key => $val)
       $this->prop['required_fields'][$key] = $this->_attr_name(strtolower($val));
 

--
Gitblit v1.9.1