Condense whitespace in composite fields (Request #8654).
authorJan Schneider <jan@horde.org>
Tue, 20 Oct 2009 22:08:32 +0000 (00:08 +0200)
committerJan Schneider <jan@horde.org>
Tue, 20 Oct 2009 22:08:32 +0000 (00:08 +0200)
turba/docs/CHANGES
turba/lib/Driver.php

index 621e221..2ae0e07 100644 (file)
@@ -10,6 +10,7 @@ v3.0-git
 v2.3.3-cvs
 ----------
 
+[jan] Condense whitespace in composite fields (Request #8654).
 [jan] Add Oracle-specific upgrade script.
 [jan] Add Croatian translation (Matej Vela <matej.vela@carnet.hr>,
       Iva Rumora <iva.rumora@zg.t-com.hr>).
index 63792a0..4e08213 100644 (file)
@@ -218,7 +218,7 @@ class Turba_Driver
                             $fieldarray[] = '';
                         }
                     }
-                    $fields[$this->map[$key]['attribute']] = trim(vsprintf($this->map[$key]['format'], $fieldarray), " \t\n\r\0\x0B,");
+                    $fields[$this->map[$key]['attribute']] = preg_replace('/\s+/', ' ', trim(vsprintf($this->map[$key]['format'], $fieldarray), " \t\n\r\0\x0B,"));
                 } else {
                     // If 'parse' is not specified, use 'format' and 'fields'.
                     if (!isset($this->map[$key]['parse'])) {