From 1c1da7f8522719480280ce1bc910f1e19cff1ce3 Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Mon, 12 Mar 2001 01:45:43 +0000 Subject: [PATCH] Add string trim to fix Netscape import and debug --- addressbook/conv/Debug Netscape to LDAP | 1 + addressbook/conv/Debug Netscape to SQL | 1 + addressbook/conv/Import from Netscape | 2 ++ 3 files changed, 4 insertions(+) diff --git a/addressbook/conv/Debug Netscape to LDAP b/addressbook/conv/Debug Netscape to LDAP index 2af0f66ff8..959812267f 100644 --- a/addressbook/conv/Debug Netscape to LDAP +++ b/addressbook/conv/Debug Netscape to LDAP @@ -163,6 +163,7 @@ objectClass: importPerson"; $this->givenName = $value; } + $value = trim($value); $value = str_replace("\n","",$value); $name = str_replace("\n","",$name); $value = str_replace("\r","",$value); diff --git a/addressbook/conv/Debug Netscape to SQL b/addressbook/conv/Debug Netscape to SQL index 1a61a94525..d88c53ca31 100644 --- a/addressbook/conv/Debug Netscape to SQL +++ b/addressbook/conv/Debug Netscape to SQL @@ -124,6 +124,7 @@ } function import_new_attrib($buffer,$name,$value) { + $value = trim($value); $value = str_replace("\n","",$value); $value = str_replace("\r","",$value); if ($value=="") { $value="NULL"; } diff --git a/addressbook/conv/Import from Netscape b/addressbook/conv/Import from Netscape index d177b9db40..8fd492da92 100644 --- a/addressbook/conv/Import from Netscape +++ b/addressbook/conv/Import from Netscape @@ -89,6 +89,8 @@ function import_new_attrib($buffer,$name,$value) { //$value = str_replace("\n","
",$value); + // chop leading space from value + $value = trim($value); $value = str_replace("\r","",$value); //echo '
'.$name.' => '.$value; $this->currentrecord += array($name => $value);