[dev] Turba and multi-line attributes in ldap

Jean-Charles Godien Jean-Charles.Godien@unice.fr
Fri, 28 Jun 2002 12:21:10 +0200


Hello,

Suggestion for the ldap driver in turba :

The $ symbol is used as separator, especially in postalAddress attribute where
they are lines separators (RFC 2252). For a correct presentation the "$" should
be replaced by a newline.

I suggest the following modification in turba/lib/Driver/ldap.php:getResults():
replace:
                             if ($this->encoding == 'utf8') {
                                 $result[$field] .= utf8_decode($entry[$field][$j]);
                             } else {
                                 $result[$field] .= $entry[$field][$j];
                             }

by:
                             if ($this->encoding == 'utf8') {
			      $tmp = utf8_decode($entry[$field][$j]);
                             } else {
			      $tmp = $entry[$field][$j];
                             }
			    $result[$field] .= str_replace('$',"\n",$tmp);


- Jean-Charles Godien -
PS:
I'm unsure for the utf8 characters.