Commit 6dbba038e25f36732d60a17828de396a8d3ab38c
1 parent
6668dd94
Try hard to ensure that extra newline/whitespace and empty lines don't
make their way into the configuration for search attributes and object classes. git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5095 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
10 additions
and
1 deletions
plugins/ktstandard/ldap/ldapbaseauthenticationprovider.inc.php
| @@ -164,7 +164,16 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { | @@ -164,7 +164,16 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider { | ||
| 164 | foreach ($this->aConfigMap as $k => $v) { | 164 | foreach ($this->aConfigMap as $k => $v) { |
| 165 | $sValue = KTUtil::arrayGet($_REQUEST, $k . '_nls'); | 165 | $sValue = KTUtil::arrayGet($_REQUEST, $k . '_nls'); |
| 166 | if ($sValue) { | 166 | if ($sValue) { |
| 167 | - $aConfig[$k] = split("\n", $sValue); | 167 | + $nls_array = split("\n", $sValue); |
| 168 | + $final_array = array(); | ||
| 169 | + foreach ($nls_array as $nls_item) { | ||
| 170 | + $nls_item = trim($nls_item); | ||
| 171 | + if (empty($nls_item)) { | ||
| 172 | + continue; | ||
| 173 | + } | ||
| 174 | + $final_array[] = $nls_item; | ||
| 175 | + } | ||
| 176 | + $aConfig[$k] = $final_array; | ||
| 168 | continue; | 177 | continue; |
| 169 | } | 178 | } |
| 170 | $sValue = KTUtil::arrayGet($_REQUEST, $k); | 179 | $sValue = KTUtil::arrayGet($_REQUEST, $k); |