[horde] FW: Horde 4 - Setlocale Error

B.Baransel BAĞCI bagcib at itu.edu.tr
Sun Mar 25 14:54:35 UTC 2012


Hi list,

 

I have posted this error to developer list but they said it's caused by 3rd
party software CSSTidy. This project has been suspended.

 

Are there anyone similar to this error? 

 

Details:

 

When i try horde 4 & imp 5 i have an error about "setlocale" function in
/usr/share/pear/Horde/Text/Filter/Csstidy/class.csstidy.php :823

 

In horde log:

 

==> /var/log/horde.log <==

2012-03-18T15:57:01+02:00 WARN: HORDE [imp] PHP ERROR: setlocale():
Specified locale name is too long [pid 14060 on line 823 of
"/usr/share/pear/Horde/Text/Filter/Csstidy/class.csstidy.php"]

 

 

The problem is sourced from parse function in class.csstidy.php. The
function :

 

==> /usr/share/pear/Horde/Text/Filter/Csstidy/class.csstidy.php <==

440:       function parse($string) {
441:                       $old = setlocale(LC_ALL, 0);        -> save
system locale information to $old variable as string.

442:                       setlocale(LC_ALL, 'C');                   -> set
system locale type to C 

//some operations...

818:                       setlocale(LC_ALL, $old);               -> set
saved locale information again.

819:

820:                                       return !(empty($this->css) &&
empty($this->import) && empty($this->charset) && empty($this->tokens) &&
empty($this->namespace));

821:                       }

 

 

My setlocale(LC_ALL,0) is returned this :

 

LC_CTYPE=en_US.UTF8;LC_NUMERIC=en_GB.UTF-8;LC_TIME=en_GB.UTF-8;LC_COLLATE=en
_GB.UTF-8;LC_MONETARY=en_GB.UTF-8;LC_MESSAGES=en_GB.UTF-8;LC_PAPER=en_GB.UTF
-8;LC_NAME=en_GB.UTF-8;LC_ADDRESS=en_GB.UTF-8;LC_TELEPHONE=en_GB.UTF-8;LC_ME
ASUREMENT=en_GB.UTF-8;LC_IDENTIFICATION=en_GB.UTF-8

 

 

I think string is too long, so i tried this code instead of
"setlocale(LC_ALL, $old)" on line 818.

 

foreach (explode(";", $old) as $tmp_LC_Part) {

  if (strpos($tmp_LC_Part, "=") !== false) {

    list ($category, $locale) = explode("=", $tmp_LC_Part);

  }

  else {

    $category = LC_ALL;

    $locale   = $tmp_LC_Part;

  }

  setlocale($category, $locale);

}

 

 

 

But this time I get this error(s):

 

==> /var/log/horde.log <==

2012-03-18T17:09:35+02:00 WARN: HORDE [imp] PHP ERROR: setlocale(): Invalid
locale category name LC_PAPER, must be one of LC_ALL, LC_COLLATE, LC_CTYPE,
LC_MONETARY, LC_NUMERIC, or LC_TIME [pid 14865 on line 827 of
"/usr/share/pear/Horde/Text/Filter/Csstidy/class.csstidy.php"]

2012-03-18T17:09:35+02:00 WARN: HORDE [imp] PHP ERROR: setlocale(): Invalid
locale category name LC_NAME, must be one of LC_ALL, LC_COLLATE, LC_CTYPE,
LC_MONETARY, LC_NUMERIC, or LC_TIME [pid 14865 on line 827 of
"/usr/share/pear/Horde/Text/Filter/Csstidy/class.csstidy.php"]

2012-03-18T17:09:35+02:00 WARN: HORDE [imp] PHP ERROR: setlocale(): Invalid
locale category name LC_ADDRESS, must be one of LC_ALL, LC_COLLATE,
LC_CTYPE, LC_MONETARY, LC_NUMERIC, or LC_TIME [pid 14865 on line 827 of
"/usr/share/pear/Horde/Text/Filter/Csstidy/class.csstidy.php"]

2012-03-18T17:09:35+02:00 WARN: HORDE [imp] PHP ERROR: setlocale(): Invalid
locale category name LC_TELEPHONE, must be one of LC_ALL, LC_COLLATE,
LC_CTYPE, LC_MONETARY, LC_NUMERIC, or LC_TIME [pid 14865 on line 827 of
"/usr/share/pear/Horde/Text/Filter/Csstidy/class.csstidy.php"]

2012-03-18T17:09:35+02:00 WARN: HORDE [imp] PHP ERROR: setlocale(): Invalid
locale category name LC_MEASUREMENT, must be one of LC_ALL, LC_COLLATE,
LC_CTYPE, LC_MONETARY, LC_NUMERIC, or LC_TIME [pid 14865 on line 827 of
"/usr/share/pear/Horde/Text/Filter/Csstidy/class.csstidy.php"]

2012-03-18T17:09:35+02:00 WARN: HORDE [imp] PHP ERROR: setlocale(): Invalid
locale category name LC_IDENTIFICATION, must be one of LC_ALL, LC_COLLATE,
LC_CTYPE, LC_MONETARY, LC_NUMERIC, or LC_TIME [pid 14865 on line 827 of
"/usr/share/pear/Horde/Text/Filter/Csstidy/class.csstidy.php"]

 

 

Some of properties didn't accepted. I tried some of languages english
(gb,us) or anothers. Problem is same. I'm running Horde 4.0.13 on PHP 5.3.3
with Apache 2.2.15 on RHEL 6.

 

---

Regards.

B.Baransel BAĞCI

Istanbul Technical University



More information about the horde mailing list