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.

This commit is contained in:
Laurent Destailleur 2009-10-04 18:01:30 +00:00
parent f68be991ff
commit eb4d353f11
14 changed files with 61 additions and 57 deletions

View File

@ -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)
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>';

View File

@ -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<6C>e suppl<70>mentaire if (file_exists($filedetail)) { // propal d<>taill<6C>e suppl<70>mentaire
print "<tr $bc[$var]><td>Propal d<EFBFBD>taill<EFBFBD>e</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";

View File

@ -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<6C>e suppl<70>mentaire if (file_exists($filedetail)) { // commande d<>taill<6C>e suppl<70>mentaire
print "<tr $bc[$var]><td>Commande d<EFBFBD>taill<EFBFBD>e</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";

View File

@ -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 d<EFBFBD>taill<EFBFBD>e suppl<70>mentaire if (file_exists($filedetail)) // facture detaillee supplementaire
{ {
print "<tr $bc[$var]><td>Facture d<>taill<6C>e</td>"; print "<tr $bc[$var]><td>Facture d<>taill<6C>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>';
} }

View File

@ -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>';

View File

@ -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++;
} }

View File

@ -24,7 +24,7 @@
/** /**
\file htdocs/fichinter/apercu.php \file htdocs/fichinter/apercu.php
\ingroup fichinter \ingroup fichinter
\brief Page de l'onglet aperçu d'une fiche d'intervention \brief Page de l'onglet aper<EFBFBD>u d'une fiche d'intervention
\version $Revision$ \version $Revision$
*/ */
@ -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 aperçus // Chemin vers png aper<EFBFBD>us
$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) {
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 détaillée supplémentaire if (file_exists($filedetail)) { // fichinter d<EFBFBD>taill<EFBFBD>e suppl<70>mentaire
print "<tr $bc[$var]><td>Fiche d'intervention détaillée</td>"; print "<tr $bc[$var]><td>Fiche d'intervention d<EFBFBD>taill<EFBFBD>e</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) {
dol_print_error($db); dol_print_error($db);
} }
} else { } else {
// Intervention non trouvée // Intervention non trouv<EFBFBD>e
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<EFBFBD>
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<EFBFBD>
elseif (file_exists($fileimagebis)) elseif (file_exists($fileimagebis))
{ {
$multiple = $relativepathimage . "."; $multiple = $relativepathimage . ".";

View File

@ -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)
{ {

View File

@ -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)
$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)
$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)
$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;

View File

@ -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");

View File

@ -1,7 +1,7 @@
<?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 / Océbo <marc@ocebo.com> * Copyright (C) 2005 Marc Barilley / Oc<EFBFBD>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 @@
/** /**
* \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 créer * \brief Test si le fichier conf est modifiable et si il n'existe pas, test la possibilit<EFBFBD> de le cr<EFBFBD>er
* \version $Id$ * \version $Id$
*/ */
include_once("./inc.php"); include_once("./inc.php");
@ -151,7 +151,7 @@ if ($memmaxorig != '')
} }
// Si fichier présent 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)
$confexists=1; $confexists=1;
include_once($conffile); include_once($conffile);
// Deja installé, on peut upgrader // Deja install<EFBFBD>, on peut upgrader
// \todo Test if database ok // \todo Test if database ok
$allowupgrade=1; $allowupgrade=1;
} }
else else
{ {
// Si non on le crée // Si non on le cr<EFBFBD>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
// Si fichier absent et n'a pu etre créé // Si fichier absent et n'a pu etre cr<EFBFBD><EFBFBD>
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))
} }
else else
{ {
// Si fichier présent mais ne peut etre modifié // Si fichier pr<EFBFBD>sent mais ne peut etre modifi<66>
if (!is_writable($conffile)) if (!is_writable($conffile))
{ {
if ($confexists) if ($confexists)
@ -227,7 +227,7 @@ else
$allowinstall=0; $allowinstall=0;
} }
// Si fichier présent et peut etre modifié // Si fichier pr<EFBFBD>sent et peut etre modifi<66>
else else
{ {
if ($confexists) if ($confexists)
@ -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 <EFBFBD> l'<27>tape suivante
if ($checksok) if ($checksok)
{ {
$ok=0; $ok=0;

View File

@ -230,10 +230,10 @@ class CMailFile
$mail->B3B = $this->alternative_boundary; $mail->B3B = $this->alternative_boundary;
$mail->XMailer = "Dolibarr version " . DOL_VERSION ." (using simplemail)"; $mail->XMailer = "Dolibarr version " . DOL_VERSION ." (using simplemail)";
// Add Errors-To // Add Errors-To
$mail->ErrorsTo = $this->getValidAddress($errors_to,1); $mail->ErrorsTo = $this->getValidAddress($errors_to,1);
//Add Return-Path //Add Return-Path
$mail->returnpath = $this->getValidAddress($errors_to,1); $mail->returnpath = $this->getValidAddress($errors_to,1);

View 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)
* @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);
} }
/** /**

View File

@ -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";
} }
} }