From a4ae2ca8b6efa07b62312484c0c6d3577263b322 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 25 Jun 2011 18:40:59 +0000 Subject: [PATCH] Fix: upgrade tcpdf with some fix --- htdocs/includes/dolibarr_changes.txt | 9 +++++++-- htdocs/includes/tcpdf/config/tcpdf_config.php | 8 ++++++++ htdocs/includes/tcpdf/tcpdf.php | 5 +---- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/htdocs/includes/dolibarr_changes.txt b/htdocs/includes/dolibarr_changes.txt index 01a1e6667e4..66bd0475a94 100644 --- a/htdocs/includes/dolibarr_changes.txt +++ b/htdocs/includes/dolibarr_changes.txt @@ -45,8 +45,13 @@ public function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=false, $ln= by public function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=false, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=false, $maxh=0, $valign='T', $fitcell=false) { -* Open tcpdf.php and find function getRandomSeed() -in this function change "getmypid()" by "mt_rand()" +* Open /tcpdf/config/tcpdf_config.php and add this function : + +if (! function_exists('getmypid')) { + function getmypid() { + return rand(1,32768); + } +} JSGANTT: diff --git a/htdocs/includes/tcpdf/config/tcpdf_config.php b/htdocs/includes/tcpdf/config/tcpdf_config.php index 811145f7671..8dfb4029e2b 100644 --- a/htdocs/includes/tcpdf/config/tcpdf_config.php +++ b/htdocs/includes/tcpdf/config/tcpdf_config.php @@ -26,6 +26,14 @@ * @since 2004-10-27 */ +// DOLCHANGE RH +if (! function_exists('getmypid')) { + function getmypid() { + return rand(1,32768); + } +} +// END DOLCHANGE + // If you define the constant K_TCPDF_EXTERNAL_CONFIG, the following settings will be ignored. if (!defined('K_TCPDF_EXTERNAL_CONFIG')) { diff --git a/htdocs/includes/tcpdf/tcpdf.php b/htdocs/includes/tcpdf/tcpdf.php index e7fa9ca7439..ba4bebaba7c 100644 --- a/htdocs/includes/tcpdf/tcpdf.php +++ b/htdocs/includes/tcpdf/tcpdf.php @@ -12089,10 +12089,7 @@ class TCPDF { } $seed .= uniqid('', true); $seed .= rand(); - // DOLCHANGE RH - //$seed .= getmypid(); - $seed .= mt_rand(); - // END DOLCHANGE + $seed .= getmypid(); $seed .= __FILE__; $seed .= $this->bufferlen; if (isset($_SERVER['REMOTE_ADDR'])) {