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

Sec: Fix creation of temp dir in right place.

parent 2454b102
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,9 @@ in Dolibarr root.
FPDF:
-----
* All changes were added in fpdf.php file and marked with tag DOLCHANGE
* All changes were added in fpdf.php file and marked with tag DOLCHANGE or DOL_CHANGE
Example:
$tmp=tempnam('.','gif') into $tmp=tempnam(DOL_DATA_ROOT,'gif') to avoid creating files in the htdocs directory.
FPDFI and FPDF_TPL:
......
......@@ -11,9 +11,9 @@
/* Begin DOLCHANGE Added by Regis */
// height of cell repect font height
define("K_CELL_HEIGHT_RATIO", 1.25);
// Rpertoire des documents de fckeditor
// R�pertoire des documents de fckeditor
if (! empty($conf->fckeditor->dir_output)) define ("K_PATH_CACHE", $conf->fckeditor->dir_output);
// url qui sera substituer par le K_PATH_CACHE lorsqu'une image sera intgre au pdf
// url qui sera substituer par le K_PATH_CACHE lorsqu'une image sera int�gr�e au pdf
if (defined('DOL_URL_ROOT')) define ("K_PATH_URL_CACHE", DOL_URL_ROOT."/document.php?modulepart=editor&file=");
/* End DOLCHANGE Added by Regis */
......@@ -85,7 +85,7 @@ var $PDFVersion; //PDF version number
var $prevFontFamily; //store previous font family
var $prevFontStyle; //store previous style family
var $DisplayPreferences=''; //prfrences d'affichage
var $DisplayPreferences=''; //pr�f�rences d'affichage
// variables pour HTML PARSER
......@@ -1516,10 +1516,12 @@ function _parsegif($file)
if(!$im)
$this->Error('Missing or incorrect image file: '.$file);
imageinterlace($im,0);
$tmp=tempnam('.','gif');
// DOL_CHANGE
$tmp=tempnam(DOL_DATA_ROOT,'gif');
//$tmp=tempnam('.','gif');
if(!$tmp)
$this->Error('Unable to create a temporary file');
if(!imagepng($im,$tmp))
if(!imagepng($im,$tmp))
$this->Error('Error while saving to temporary file');
imagedestroy($im);
$info=$this->_parsepng($tmp);
......@@ -1852,8 +1854,8 @@ function _putcatalog()
/* Begin DOLCHANGE Added by Regis */
//Prfrences d'affichage - @author Michel Poulain
//affiche le document en plein cran (escape pour revenir en mode normal)
//Pr�f�rences d'affichage - @author Michel Poulain
//affiche le document en plein �cran (escape pour revenir en mode normal)
if(is_int(strpos($this->DisplayPreferences,'FullScreen')))
$this->_out('/PageMode /FullScreen');
if($this->DisplayPreferences) {
......@@ -1864,16 +1866,16 @@ function _putcatalog()
//masque les barres d'outils
if(is_int(strpos($this->DisplayPreferences,'HideToolbar')))
$this->_out('/HideToolbar true');
//masque tous les lments de la fentre (barres de dfilement, contrles de navigation, signets...)
//masque tous les �l�ments de la fen�tre (barres de d�filement, contr�les de navigation, signets...)
if(is_int(strpos($this->DisplayPreferences,'HideWindowUI')))
$this->_out('/HideWindowUI true');
//affiche le titre du document au lieu du nom du fichier
if(is_int(strpos($this->DisplayPreferences,'DisplayDocTitle')))
$this->_out('/DisplayDocTitle true');
//centre la fentre
//centre la fen�tre
if(is_int(strpos($this->DisplayPreferences,'CenterWindow')))
$this->_out('/CenterWindow true');
//ajuste la taille de la fentre (lorsqu'elle n'est pas maximise) sur celle de la page
//ajuste la taille de la fen�tre (lorsqu'elle n'est pas maximis�e) sur celle de la page
if(is_int(strpos($this->DisplayPreferences,'FitWindow')))
$this->_out('/FitWindow true');
$this->_out('>>');
......@@ -1970,7 +1972,7 @@ function _enddoc()
}
elseif($this->tdbegin) {
if((strlen(trim($element)) > 0) AND ($element != " ")) {
// Cette version ne gre pas UTF8
// Cette version ne g�re pas UTF8
//$this->Cell($this->tdwidth, $this->tdheight, $this->unhtmlentities($element), $this->tableborder, '', $this->tdalign, $this->tdbgcolor);
$this->Cell($this->tdwidth, $this->tdheight, utf8_decode($this->unhtmlentities($element)), $this->tableborder, '', $this->tdalign, $this->tdbgcolor);
}
......@@ -1979,7 +1981,7 @@ function _enddoc()
}
}
else {
// cette version ne gre pas UTF8
// cette version ne g�re pas UTF8
//$this->Write($this->lasth, stripslashes($this->unhtmlentities($element)), '', $fill);
$this->Write($this->lasth, stripslashes(utf8_decode($this->unhtmlentities($element))), '', $fill);
}
......@@ -2602,7 +2604,7 @@ function _enddoc()
/**
* Converti les noms des polices FckEditor.
* @string string chaine convertir
* @string string chaine � convertir
* @return string chaine convertie.
* @author Regis Houssin
*/
......@@ -2636,8 +2638,8 @@ function _enddoc()
}
/**
* Paramtrage des prfrences d'affichage.
* @string preference liste des prfrences d'affichage (voir la fonction _putcatalog)
* Param�trage des pr�f�rences d'affichage.
* @string preference liste des pr�f�rences d'affichage (voir la fonction _putcatalog)
* @ex: $pdf->DisplayPreferences('HideMenubar,HideToolbar,HideWindowUI')
* @author Michel Poulain
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment