Skip to content
Snippets Groups Projects
Commit eb4d353f authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: Data in memory must always be encoded in utf8. PHP files functions need...

Fix: Data in memory must always be encoded in utf8. PHP files functions need ISO, so we convert data just before and after using them.
parent f68be991
Branches
Tags
No related merge requests found
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
*/ */
require_once("./pre.inc.php"); require_once("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
require_once(DOL_DOCUMENT_ROOT."/contact.class.php"); require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php"); require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php");
require_once(DOL_DOCUMENT_ROOT."/includes/modules/action/rapport.pdf.php"); require_once(DOL_DOCUMENT_ROOT."/includes/modules/action/rapport.pdf.php");
...@@ -121,8 +122,8 @@ if ($resql) ...@@ -121,8 +122,8 @@ if ($resql)
if (file_exists($file)) if (file_exists($file))
{ {
print '<td align="center"><a href="'.DOL_URL_ROOT.'/document.php?page='.$page.'&amp;file='.urlencode($relativepath).'&amp;modulepart=actionsreport">'.img_pdf().'</a></td>'; print '<td align="center"><a href="'.DOL_URL_ROOT.'/document.php?page='.$page.'&amp;file='.urlencode($relativepath).'&amp;modulepart=actionsreport">'.img_pdf().'</a></td>';
print '<td align="center">'.dol_print_date(filemtime($file),'dayhour').'</td>'; print '<td align="center">'.dol_print_date(dol_filemtime($file),'dayhour').'</td>';
print '<td align="center">'.filesize($file). ' '.$langs->trans("Bytes").'</td>'; print '<td align="center">'.dol_print_size(dol_filesize($file)).'</td>';
} }
else { else {
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
......
...@@ -158,17 +158,17 @@ if ($_GET["propalid"] > 0) ...@@ -158,17 +158,17 @@ if ($_GET["propalid"] > 0)
print "<tr $bc[$var]><td>".$langs->trans("Propal")." PDF</td>"; print "<tr $bc[$var]><td>".$langs->trans("Propal")." PDF</td>";
print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=propal&file='.urlencode($relativepath).'">'.$propal->ref.'.pdf</a></td>'; print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=propal&file='.urlencode($relativepath).'">'.$propal->ref.'.pdf</a></td>';
print '<td align="right">'.filesize($file). ' bytes</td>'; print '<td align="right">'.dol_print_size(dol_filesize($file)).'</td>';
print '<td align="right">'.dol_print_date(filemtime($file),'dayhour').'</td>'; print '<td align="right">'.dol_print_date(dol_filemtime($file),'dayhour').'</td>';
print '</tr>'; print '</tr>';
// Si fichier detail PDF existe // Si fichier detail PDF existe
if (file_exists($filedetail)) { // propal d�taill�e suppl�mentaire if (file_exists($filedetail)) { // propal d�taill�e suppl�mentaire
print "<tr $bc[$var]><td>Propal dtaille</td>"; print "<tr $bc[$var]><td>Propal detaillee</td>";
print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=propal&file='.urlencode($relativepathdetail).'">'.$propal->ref.'-detail.pdf</a></td>'; print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=propal&file='.urlencode($relativepathdetail).'">'.$propal->ref.'-detail.pdf</a></td>';
print '<td align="right">'.filesize($filedetail). ' bytes</td>'; print '<td align="right">'.dol_print_size(dol_filesize($filedetail)).'</td>';
print '<td align="right">'.dol_print_date(filemtime($filedetail),'dayhour').'</td>'; print '<td align="right">'.dol_print_date(dol_filemtime($filedetail),'dayhour').'</td>';
print '</tr>'; print '</tr>';
} }
print "</table>\n"; print "</table>\n";
......
...@@ -153,17 +153,17 @@ if ($_GET["id"] > 0) { ...@@ -153,17 +153,17 @@ if ($_GET["id"] > 0) {
print "<tr $bc[$var]><td>".$langs->trans("Order")." PDF</td>"; print "<tr $bc[$var]><td>".$langs->trans("Order")." PDF</td>";
print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=commande&file='.urlencode($relativepath).'">'.$commande->ref.'.pdf</a></td>'; print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=commande&file='.urlencode($relativepath).'">'.$commande->ref.'.pdf</a></td>';
print '<td align="right">'.filesize($file). ' bytes</td>'; print '<td align="right">'.dol_print_size(dol_filesize($file)).'</td>';
print '<td align="right">'.dol_print_date(filemtime($file),'dayhour').'</td>'; print '<td align="right">'.dol_print_date(dol_filemtime($file),'dayhour').'</td>';
print '</tr>'; print '</tr>';
// Si fichier detail PDF existe // Si fichier detail PDF existe
if (file_exists($filedetail)) { // commande d�taill�e suppl�mentaire if (file_exists($filedetail)) { // commande d�taill�e suppl�mentaire
print "<tr $bc[$var]><td>Commande dtaille</td>"; print "<tr $bc[$var]><td>Commande detaillee</td>";
print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=commande&file='.urlencode($relativepathdetail).'">'.$commande->ref.'-detail.pdf</a></td>'; print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=commande&file='.urlencode($relativepathdetail).'">'.$commande->ref.'-detail.pdf</a></td>';
print '<td align="right">'.filesize($filedetail). ' bytes</td>'; print '<td align="right">'.dol_print_size(dol_filesize($filedetail)).'</td>';
print '<td align="right">'.dol_print_date(filemtime($filedetail),'dayhour').'</td>'; print '<td align="right">'.dol_print_date(dol_filemtime($filedetail),'dayhour').'</td>';
print '</tr>'; print '</tr>';
} }
print "</table>\n"; print "</table>\n";
......
...@@ -163,18 +163,18 @@ if ($_GET["facid"] > 0) ...@@ -163,18 +163,18 @@ if ($_GET["facid"] > 0)
print "<tr $bc[$var]><td>".$langs->trans("Bill")." PDF</td>"; print "<tr $bc[$var]><td>".$langs->trans("Bill")." PDF</td>";
print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=facture&file='.urlencode($relativepath).'">'.$fac->ref.'.pdf</a></td>'; print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=facture&file='.urlencode($relativepath).'">'.$fac->ref.'.pdf</a></td>';
print '<td align="right">'.filesize($file). ' bytes</td>'; print '<td align="right">'.dol_print_size(dol_filesize($file)). '</td>';
print '<td align="right">'.dol_print_date(filemtime($file),'dayhour').'</td>'; print '<td align="right">'.dol_print_date(dol_filemtime($file),'dayhour').'</td>';
print '</tr>'; print '</tr>';
// Si fichier detail PDF existe // Si fichier detail PDF existe
if (file_exists($filedetail)) // facture dtaille supplmentaire if (file_exists($filedetail)) // facture detaillee supplementaire
{ {
print "<tr $bc[$var]><td>Facture d�taill�e</td>"; print "<tr $bc[$var]><td>Facture d�taill�e</td>";
print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=facture&file='.urlencode($relativepathdetail).'">'.$fac->ref.'-detail.pdf</a></td>'; print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=facture&file='.urlencode($relativepathdetail).'">'.$fac->ref.'-detail.pdf</a></td>';
print '<td align="right">'.filesize($filedetail). ' bytes</td>'; print '<td align="right">'.dol_print_size(dol_filesize($filedetail)).'</td>';
print '<td align="right">'.dol_print_date(filemtime($filedetail),"%d %b %Y %H:%M:%S").'</td>'; print '<td align="right">'.dol_print_date(dol_filemtime($filedetail),'dayhour').'</td>';
print '</tr>'; print '</tr>';
} }
......
...@@ -171,8 +171,8 @@ if ($year) ...@@ -171,8 +171,8 @@ if ($year)
$tfile = $dir . '/'.$year.'/'.$file; $tfile = $dir . '/'.$year.'/'.$file;
$relativepath = $year.'/'.$file; $relativepath = $year.'/'.$file;
print "<tr $bc[$var]>".'<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=facture_paiement&amp;file='.urlencode($relativepath).'">'.img_pdf().' '.$file.'</a></td>'; print "<tr $bc[$var]>".'<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=facture_paiement&amp;file='.urlencode($relativepath).'">'.img_pdf().' '.$file.'</a></td>';
print '<td align="right">'.filesize($tfile). ' '.$langs->trans("Bytes").'</td>'; print '<td align="right">'.dol_print_size(dol_filesize($tfile)).'</td>';
print '<td align="right">'.dol_print_date(filemtime($tfile),"dayhour").'</td></tr>'; print '<td align="right">'.dol_print_date(dol_filemtime($tfile),"dayhour").'</td></tr>';
} }
} }
print '</table>'; print '</table>';
......
...@@ -125,8 +125,8 @@ if ($handle) ...@@ -125,8 +125,8 @@ if ($handle)
if (!is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') if (!is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
{ {
$filearray[$i]->name=$file; $filearray[$i]->name=$file;
$filearray[$i]->size=filesize($upload_dir."/".$file); $filearray[$i]->size=dol_filesize($upload_dir."/".$file);
$filearray[$i]->date=filemtime($upload_dir."/".$file); $filearray[$i]->date=dol_filemtime($upload_dir."/".$file);
$totalsize+=$filearray[$i]->size; $totalsize+=$filearray[$i]->size;
$i++; $i++;
} }
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
/** /**
\file htdocs/fichinter/apercu.php \file htdocs/fichinter/apercu.php
\ingroup fichinter \ingroup fichinter
\brief Page de l'onglet aperu d'une fiche d'intervention \brief Page de l'onglet aperu d'une fiche d'intervention
\version $Revision$ \version $Revision$
*/ */
...@@ -107,7 +107,7 @@ if ($_GET["id"] > 0) { ...@@ -107,7 +107,7 @@ if ($_GET["id"] > 0) {
$relativepath = "${fichinterref}/${fichinterref}.pdf"; $relativepath = "${fichinterref}/${fichinterref}.pdf";
$relativepathdetail = "${fichinterref}/${fichinterref}-detail.pdf"; $relativepathdetail = "${fichinterref}/${fichinterref}-detail.pdf";
// Chemin vers png aperus // Chemin vers png aperus
$relativepathimage = "${fichinterref}/${fichinterref}.pdf.png"; $relativepathimage = "${fichinterref}/${fichinterref}.pdf.png";
$fileimage = $file.".png"; // Si PDF d'1 page $fileimage = $file.".png"; // Si PDF d'1 page
$fileimagebis = $file.".png.0"; // Si PDF de plus d'1 page $fileimagebis = $file.".png.0"; // Si PDF de plus d'1 page
...@@ -124,17 +124,17 @@ if ($_GET["id"] > 0) { ...@@ -124,17 +124,17 @@ if ($_GET["id"] > 0) {
print "<tr $bc[$var]><td>".$langs->trans("Intervention")." PDF</td>"; print "<tr $bc[$var]><td>".$langs->trans("Intervention")." PDF</td>";
print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=ficheinter&file='.urlencode($relativepath).'">'.$fichinter->ref.'.pdf</a></td>'; print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=ficheinter&file='.urlencode($relativepath).'">'.$fichinter->ref.'.pdf</a></td>';
print '<td align="right">'.filesize($file). ' bytes</td>'; print '<td align="right">'.dol_print_size(dol_filesize($file)).'</td>';
print '<td align="right">'.dol_print_date(filemtime($file),'dayhour').'</td>'; print '<td align="right">'.dol_print_date(dol_filemtime($file),'dayhour').'</td>';
print '</tr>'; print '</tr>';
// Si fichier detail PDF existe // Si fichier detail PDF existe
if (file_exists($filedetail)) { // fichinter dtaille supplmentaire if (file_exists($filedetail)) { // fichinter dtaille supplmentaire
print "<tr $bc[$var]><td>Fiche d'intervention dtaille</td>"; print "<tr $bc[$var]><td>Fiche d'intervention dtaille</td>";
print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=ficheinter&file='.urlencode($relativepathdetail).'">'.$fichinter->ref.'-detail.pdf</a></td>'; print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=ficheinter&file='.urlencode($relativepathdetail).'">'.$fichinter->ref.'-detail.pdf</a></td>';
print '<td align="right">'.filesize($filedetail). ' bytes</td>'; print '<td align="right">'.dol_print_size(dol_filesize($filedetail)).'</td>';
print '<td align="right">'.dol_print_date(filemtime($filedetail),'dayhour').'</td>'; print '<td align="right">'.dol_print_date(dol_filemtime($filedetail),'dayhour').'</td>';
print '</tr>'; print '</tr>';
} }
print "</table>\n"; print "</table>\n";
...@@ -193,17 +193,17 @@ if ($_GET["id"] > 0) { ...@@ -193,17 +193,17 @@ if ($_GET["id"] > 0) {
dol_print_error($db); dol_print_error($db);
} }
} else { } else {
// Intervention non trouve // Intervention non trouve
print $langs->trans("ErrorFichinterNotFound",$_GET["id"]); print $langs->trans("ErrorFichinterNotFound",$_GET["id"]);
} }
} }
// Si fichier png PDF d'1 page trouv // Si fichier png PDF d'1 page trouv
if (file_exists($fileimage)) if (file_exists($fileimage))
{ {
print '<img src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercufichinter&file='.urlencode($relativepathimage).'">'; print '<img src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercufichinter&file='.urlencode($relativepathimage).'">';
} }
// Si fichier png PDF de plus d'1 page trouv // Si fichier png PDF de plus d'1 page trouv
elseif (file_exists($fileimagebis)) elseif (file_exists($fileimagebis))
{ {
$multiple = $relativepathimage . "."; $multiple = $relativepathimage . ".";
......
...@@ -376,9 +376,9 @@ class FormFile ...@@ -376,9 +376,9 @@ class FormFile
print '</a>'; print '</a>';
if (!$iconPDF) print '</td>'; if (!$iconPDF) print '</td>';
// Affiche taille fichier // Affiche taille fichier
if (!$iconPDF) print '<td align="right">'.dol_print_size(filesize($filedir."/".$file["name"])).'</td>'; if (!$iconPDF) print '<td align="right">'.dol_print_size(dol_filesize($filedir."/".$file["name"])).'</td>';
// Affiche date fichier // Affiche date fichier
if (!$iconPDF) print '<td align="right">'.dol_print_date(filemtime($filedir."/".$file["name"]),'dayhour').'</td>'; if (!$iconPDF) print '<td align="right">'.dol_print_date(dol_filemtime($filedir."/".$file["name"]),'dayhour').'</td>';
if ($delallowed) if ($delallowed)
{ {
......
...@@ -561,9 +561,9 @@ if ($step == 3 && $datatoimport) ...@@ -561,9 +561,9 @@ if ($step == 3 && $datatoimport)
print '<td width="16">'.img_mime($file).'</td>'; print '<td width="16">'.img_mime($file).'</td>';
print '<td>'.$file.'</td>'; print '<td>'.$file.'</td>';
// Affiche taille fichier // Affiche taille fichier
print '<td align="right">'.dol_print_size(filesize($newdir.'/'.$newfile)).'</td>'; print '<td align="right">'.dol_print_size(dol_filesize($newdir.'/'.$newfile)).'</td>';
// Affiche date fichier // Affiche date fichier
print '<td align="right">'.dol_print_date(filemtime($newdir.'/'.$newfile),'dayhour').'</td>'; print '<td align="right">'.dol_print_date(dol_filemtime($newdir.'/'.$newfile),'dayhour').'</td>';
// Del button // Del button
print '<td align="right"><a href="'.DOL_URL_ROOT.'/document.php?action=remove_file&step=3&format='.$format.'&modulepart='.$modulepart.'&file='.urlencode($relativepath); print '<td align="right"><a href="'.DOL_URL_ROOT.'/document.php?action=remove_file&step=3&format='.$format.'&modulepart='.$modulepart.'&file='.urlencode($relativepath);
print '&amp;urlsource='.urlencode($urlsource); print '&amp;urlsource='.urlencode($urlsource);
...@@ -621,6 +621,8 @@ if ($step == 4 && $datatoimport) ...@@ -621,6 +621,8 @@ if ($step == 4 && $datatoimport)
$maxpos=max(sizeof($fieldssource),sizeof($fieldstarget)); $maxpos=max(sizeof($fieldssource),sizeof($fieldstarget));
//var_dump($array_match_file_to_database);
// Is it a first time in page // Is it a first time in page
if (sizeof($array_match_file_to_database) == 0) if (sizeof($array_match_file_to_database) == 0)
{ {
...@@ -631,7 +633,7 @@ if ($step == 4 && $datatoimport) ...@@ -631,7 +633,7 @@ if ($step == 4 && $datatoimport)
$pos=1; $pos=1;
while ($pos <= sizeof($fieldssource)) while ($pos <= sizeof($fieldssource))
{ {
if (sizeof($fieldssource) > 1 && $pos <= sizeof($fieldssource)) if (sizeof($fieldssource) >= 1 && $pos <= sizeof($fieldssource))
{ {
$posbis=1; $posbis=1;
foreach($fieldstarget as $key => $val) foreach($fieldstarget as $key => $val)
...@@ -750,6 +752,7 @@ if ($step == 4 && $datatoimport) ...@@ -750,6 +752,7 @@ if ($step == 4 && $datatoimport)
$fieldsplaced=array(); $fieldsplaced=array();
$valforsourcefieldnb=array(); $valforsourcefieldnb=array();
$listofkeys=array();
foreach($array_match_file_to_database as $key => $val) foreach($array_match_file_to_database as $key => $val)
{ {
$listofkeys[$key]=1; $listofkeys[$key]=1;
......
...@@ -160,12 +160,12 @@ class ImportCsv extends ModeleImports ...@@ -160,12 +160,12 @@ class ImportCsv extends ModeleImports
function import_open_file($file) function import_open_file($file)
{ {
global $langs; global $langs;
$ret=1;
dol_syslog("ImportCsv::open_file file=".$file); dol_syslog("ImportCsv::open_file file=".$file);
$ret=1; $newfile=utf8_check($file)?utf8_decode($file):$file; // fopen need ISO file name
$this->handle = fopen($newfile, "r");
$this->handle = fopen($file, "r");
if (! $this->handle) if (! $this->handle)
{ {
$langs->load("errors"); $langs->load("errors");
......
<?php <?php
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocbo <marc@ocebo.com> * Copyright (C) 2005 Marc Barilley / Oc�bo <marc@ocebo.com>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
/** /**
* \file htdocs/install/check.php * \file htdocs/install/check.php
* \ingroup install * \ingroup install
* \brief Test si le fichier conf est modifiable et si il n'existe pas, test la possibilit de le crer * \brief Test si le fichier conf est modifiable et si il n'existe pas, test la possibilit� de le cr�er
* \version $Id$ * \version $Id$
*/ */
include_once("./inc.php"); include_once("./inc.php");
...@@ -151,7 +151,7 @@ if ($memmaxorig != '') ...@@ -151,7 +151,7 @@ if ($memmaxorig != '')
} }
// Si fichier prsent et lisible et renseign // Si fichier present et lisible et renseigne
clearstatcache(); clearstatcache();
if (is_readable($conffile) && filesize($conffile) > 8) if (is_readable($conffile) && filesize($conffile) > 8)
{ {
...@@ -159,13 +159,13 @@ if (is_readable($conffile) && filesize($conffile) > 8) ...@@ -159,13 +159,13 @@ if (is_readable($conffile) && filesize($conffile) > 8)
$confexists=1; $confexists=1;
include_once($conffile); include_once($conffile);
// Deja install, on peut upgrader // Deja install�, on peut upgrader
// \todo Test if database ok // \todo Test if database ok
$allowupgrade=1; $allowupgrade=1;
} }
else else
{ {
// Si non on le cre // Si non on le cr�e
dolibarr_install_syslog("check: we try to creat conf file '$conffile'"); dolibarr_install_syslog("check: we try to creat conf file '$conffile'");
$confexists=0; $confexists=0;
...@@ -196,7 +196,7 @@ else ...@@ -196,7 +196,7 @@ else
// Si fichier absent et n'a pu etre cr // Si fichier absent et n'a pu etre cr��
if (! file_exists($conffile)) if (! file_exists($conffile))
{ {
//print '<img src="../theme/eldy/img/error.png" alt="Error"> '.$langs->trans("ConfFileDoesNotExistsAndCouldNotBeCreated",$conffile); //print '<img src="../theme/eldy/img/error.png" alt="Error"> '.$langs->trans("ConfFileDoesNotExistsAndCouldNotBeCreated",$conffile);
...@@ -210,7 +210,7 @@ if (! file_exists($conffile)) ...@@ -210,7 +210,7 @@ if (! file_exists($conffile))
} }
else else
{ {
// Si fichier prsent mais ne peut etre modifi // Si fichier pr�sent mais ne peut etre modifi�
if (!is_writable($conffile)) if (!is_writable($conffile))
{ {
if ($confexists) if ($confexists)
...@@ -227,7 +227,7 @@ else ...@@ -227,7 +227,7 @@ else
$allowinstall=0; $allowinstall=0;
} }
// Si fichier prsent et peut etre modifi // Si fichier pr�sent et peut etre modifi�
else else
{ {
if ($confexists) if ($confexists)
...@@ -246,7 +246,7 @@ else ...@@ -246,7 +246,7 @@ else
} }
print "<br />\n"; print "<br />\n";
// Si prerequis ok, on affiche le bouton pour passer l'tape suivante // Si prerequis ok, on affiche le bouton pour passer � l'�tape suivante
if ($checksok) if ($checksok)
{ {
$ok=0; $ok=0;
......
...@@ -253,7 +253,7 @@ function dol_count_nb_of_line($file) ...@@ -253,7 +253,7 @@ function dol_count_nb_of_line($file)
*/ */
function dol_filesize($pathoffile) function dol_filesize($pathoffile)
{ {
$newpathoffile=check_utf8($pathoffile)?utf8_decode($pathoffile):$pathoffile; $newpathoffile=utf8_check($pathoffile)?utf8_decode($pathoffile):$pathoffile;
return filesize($pathoffile); return filesize($pathoffile);
} }
...@@ -263,10 +263,10 @@ function dol_filesize($pathoffile) ...@@ -263,10 +263,10 @@ function dol_filesize($pathoffile)
* @param $pathoffile * @param $pathoffile
* @return timestamp Time of file * @return timestamp Time of file
*/ */
function dol_filetime($pathoffile) function dol_filemtime($pathoffile)
{ {
$newpathoffile=check_utf8($pathoffile)?utf8_decode($pathoffile):$pathoffile; $newpathoffile=utf8_check($pathoffile)?utf8_decode($pathoffile):$pathoffile;
return filemtime($nrwpathoffile); return filemtime($newpathoffile);
} }
/** /**
......
...@@ -240,8 +240,8 @@ if ($socid > 0) ...@@ -240,8 +240,8 @@ if ($socid > 0)
echo '<a href="'.DOL_URL_ROOT.'/document.php?modulepart=societe&type=application/binary&file='.urlencode($loc.'/'.$file).'">'.$file.'</a>'; echo '<a href="'.DOL_URL_ROOT.'/document.php?modulepart=societe&type=application/binary&file='.urlencode($loc.'/'.$file).'">'.$file.'</a>';
print "</td>\n"; print "</td>\n";
print '<td align="right">'.filesize($courrier_dir."/".$file). ' '.$langs->trans("bytes").'</td>'; print '<td align="right">'.dol_print_size(dol_filesize($courrier_dir."/".$file)).'</td>';
print '<td align="center">'.dol_print_date(filemtime($courrier_dir."/".$file),"dayhour").'</td>'; print '<td align="center">'.dol_print_date(dol_filemtime($courrier_dir."/".$file),'dayhour').'</td>';
print "</tr>\n"; print "</tr>\n";
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment