Package: davical
Version: 1.0.2-1
Severity: important

My enviroment sets 
LANG=de_DE.UTF-8

This leads leads to invalid XML sent to the client application, which
in turn make evolution chew on my contacts and not load anything. The
problem is the <getlastmodified>, generated by the function
ISODateToHTTPDate in always.php. It uses gmstrftime which writes
locale dependent output. In my case this leads to "Mär" in case of
march. As the output is (for some reason) not UTF8 the XML file
(which states to be UTF8) gets corrupted.

I did choose the easy fix and add a setlocale to the method. I didn't
have the time to search through the code to find a more appropriate
place. I'm also not sure that this is the only problematic part.
Perhaps it would be best to generally drop any locale information.

Christian

PS: Although my server runs oldstable the davical is the latest.

-- System Information:
Debian Release: 5.0.9
  APT prefers oldstable
  APT policy: (400, 'oldstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.9-023stab048.6-enterprise (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages davical depends on:
ii  debconf           1.5.24                 Debian configuration management sy
ii  libawl-php        0.51-1                 Andrew's Web Libraries - PHP Utili
ii  libdbd-pg-perl    2.8.7-1+lenny1         Perl DBI driver for the PostgreSQL
ii  libyaml-perl      0.66-1                 YAML Ain't Markup Language (tm)
ii  php5-pgsql        5.2.6.dfsg.1-1+lenny16 PostgreSQL module for php5
ii  postgresql-client 8.3.16-0lenny1         front-end programs for PostgreSQL 
ii  postgresql-client 8.3.16-0lenny1         front-end programs for PostgreSQL 

Versions of packages davical recommends:
ii  postgresql                8.3.16-0lenny1 object-relational SQL database (su

davical suggests no packages.

-- no debconf information
--- /usr/share/davical/htdocs/always.php.orig   2011-11-02 06:11:35.000000000 
+0100
+++ /usr/share/davical/htdocs/always.php        2012-03-03 01:10:21.000000000 
+0100
@@ -334,6 +334,7 @@
 * @param string $isodate The date to convert
 */
 function ISODateToHTTPDate( $isodate ) {
+  setlocale(LC_TIME, 'en_US');
   // Use strtotime since strptime is not available on Windows platform.
   return( gmstrftime('%a, %d %b %Y %H:%M:%S GMT', strtotime($isodate)) );
 }

Reply via email to