mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-01 04:13:28 +01:00
"fixed not correctly translated holidays downloaded from egroupware.org
(charset was not recogniced because of HTTP headers before charset line)"
This commit is contained in:
parent
cb46bce9cf
commit
1c1ae40e40
@ -291,16 +291,23 @@
|
||||
$lines = @file(EGW_SERVER_ROOT.'/calendar/egroupware.org/holidays.'.strtoupper($locale).'.csv');
|
||||
}
|
||||
else
|
||||
{
|
||||
$lines = $network->gethttpsocketfile($load_from.'/holidays.'.strtoupper($locale).'.csv');
|
||||
|
||||
}
|
||||
if (!$lines)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$charset = split("[\t\n ]+",$lines[0]); // give a bit flexibility in the syntax AND remove the lineend (\n)
|
||||
if (strpos($charset[0],'charset') !== false && $charset[1])
|
||||
// reading the holidayfile from egroupware.org via network::gethttpsocketfile contains all the headers!
|
||||
foreach($lines as $n => $line)
|
||||
{
|
||||
$lines = $GLOBALS['egw']->translation->convert($lines,$charset[1]);
|
||||
$fields = split("[\t\n ]+",$line);
|
||||
|
||||
if ($fields[0] == 'charset' && $fields[1])
|
||||
{
|
||||
$lines = $GLOBALS['egw']->translation->convert($lines,$fields[1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
$c_lines = count($lines);
|
||||
foreach ($lines as $i => $line)
|
||||
|
Loading…
Reference in New Issue
Block a user