6.0.0-alpha10
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
5/16/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#2] Carriage Return Line Feed supposed to be a $ in multiline entries in LDAP
*
Your Email Address
*
Spam protection
Enter the letters below:
..___..__ .__..__ | _/ [__)[__]| \ \__|./__.| \| ||__/
Comment
> This patch fixes an issue with Turba 1.2 where it would insert a Carriage > > Return, Line Feed instead of just Line Feed between the lines of a > > multiline entry (ie. home address) This causes a problem with Evolution > > where evolution will not display the entry in the address book if there is > > a carriage return in the entry.. But the entries should only have line > > feeds.. > > > > Patch for Turba 1.2 AND CVS HEAD > > > > > > ------- Additional Comments From urkle@drip.ws 06/17/03 16:45 ------- > > CVS HEAD Patch > > --- ldap.php.orig Fri Jun 13 10:21:15 2003 > > +++ ldap.php Tue Jun 17 14:41:25 2003 > > @@ -302,10 +302,10 @@ > > // Don't add empty attributes. > > $attributes = array_filter($attributes, array($this, > > 'cleanEmptyAttributes')); > > > > - // Encode entries. > > + // Encode entries & do CRLF to LF conversion > > foreach ($attributes as $key => $val) { > > if (!is_array($val)) { > > - $attributes[$key] = String::convertCharset($val, > > NLS::getCharset(), $this->charset); > > + $attributes[$key] = > > String::convertCharset(str_replace("\r\n",\n",$val), NLS::getCharset(), > > $this->charset); > > } > > } > > > > @@ -377,7 +377,7 @@ > > // Encode entries. > > foreach ($attributes as $key => $val) { > > if (!is_array($val)) { > > - $attributes[$key] = String::convertCharset($val, > > NLS::getCharset(), $this->charset); > > + $attributes[$key] = > > String::convertCharset(str_replace("\r\n","\n",$val), NLS::getCharset(), > > $this->charset); > > } > > } > > > > > > > > ------- Additional Comments From urkle@drip.ws 06/17/03 16:46 ------- > > Turba 1.2 patch > > --- ldap.php.orig Tue Feb 25 20:40:48 2003 > > +++ ldap.php Sun Jun 15 23:54:34 2003 > > @@ -301,14 +301,17 @@ > > // Don't add empty attributes. > > $attributes = array_filter($attributes, array($this, > > 'cleanEmptyAttributes')); > > > > - // Encode entries in UTF-8 if requested. > > - if ($this->encoding == 'utf8') { > > - foreach ($attributes as $key => $val) { > > - if (!is_array($val)) { > > - $attributes[$key] = utf8_encode($val); > > - } > > - } > > - } > > + // fix CRLF to LF in multiline entries > > + foreach ($attributes as $key => $val) { > > + if (!is_array($val)) { > > + $val = str_replace("\r\n","\n",$val); > > + // Encode entries in UTF-8 if requested. > > + if ($this->encoding == 'utf8') { > > + $val = utf8_encode($val); > > + } > > + $attributes[$key] = $val; > > + } > > + } > > > > if (!@ldap_add($this->ds, $dn, $attributes)) { > > return new PEAR_Error('Failed to add an object: [' . > > ldap_errno($this->ds) . '] "' . ldap_error($this->ds) . '" (attributes: [' . > > serialize($attributes) . ']).'); > > @@ -375,14 +378,17 @@ > > } > > } > > > > - // Encode entries in UTF-8 if requested. > > - if ($this->encoding == 'utf8') { > > - foreach ($attributes as $key => $val) { > > - if (!is_array($val)) { > > - $attributes[$key] = utf8_encode($val); > > - } > > - } > > - } > > + // fix CRLF to LF in multiline entries > > + foreach ($attributes as $key => $val) { > > + if (!is_array($val)) { > > + $val = str_replace("\r\n","\n",$val); > > + // Encode entries in UTF-8 if requested. > > + if ($this->encoding == 'utf8') { > > + $val = utf8_encode($val); > > + } > > + $attributes[$key] = $val; > > + } > > + } > > > > unset($attributes[$object_key]); > > $attributes = array_filter($attributes, array($this, > > 'cleanEmptyAttributes')); > > > > > > ------- Additional Comments From urkle@drip.ws 03/06/04 23:39 ------- > > A way needs to be created to let the driver know that the field type is of > > postal address.. > > > > ------- Additional Comments From urkle@drip.ws 03/07/04 00:12 ------- > > patch to completely fix this bug. > > change both ocurrances of > > $val = str_replace("\r\n","\n",$val); > > in the second patch posted to this. > > if (preg_match("/^((home|other)?postal|registered)address$/",%key)) { > > $val = str_replace(array("\r\n","\n"),array("$","$"),$val); > > } > > > > and then in the getResults function (around line 243) > > if ($field == 'dn') { > > $resul[$field] = $entry[$field]; > > +} elseif > (preg_match("/^((home|other)?postal|registered)address$/",$field)) { > > + if (!empty($entry[$field])) { > > + if ($this->encoding == 'utf8') { > > + $result[$field] = utf8_decode($entry[$field][0]); > > + } > > + } > > + $result[$field] = str_replace("$","\r\n",$result[$field]); > > } else { > > $result[$field] = ''; > > if (!empty($entry[$field])) { > > > > And
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers