32
1
mirror of https://github.com/vdm-io/tcpdf.git synced 2024-11-23 05:12:09 +00:00
This commit is contained in:
nicolaasuni 2011-05-17 12:46:01 +02:00
parent 3c1d9f7f4f
commit 53aa39ca0c
3 changed files with 28 additions and 13 deletions

View File

@ -1,3 +1,7 @@
5.9.080 (2011-05-17)
- A problem related to file path calculation for images was fixed.
- A problem related to unsupressed getimagesize() error was fixed.
5.9.079 (2011-05-16) 5.9.079 (2011-05-16)
- Footer() method was changed to use C128 barcode as default (instead of the previous C128B). - Footer() method was changed to use C128 barcode as default (instead of the previous C128B).

View File

@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------ ------------------------------------------------------------
Name: TCPDF Name: TCPDF
Version: 5.9.079 Version: 5.9.080
Release date: 2011-05-16 Release date: 2011-05-17
Author: Nicola Asuni Author: Nicola Asuni
Copyright (c) 2002-2011: Copyright (c) 2002-2011:

View File

@ -1,9 +1,9 @@
<?php <?php
//============================================================+ //============================================================+
// File name : tcpdf.php // File name : tcpdf.php
// Version : 5.9.079 // Version : 5.9.080
// Begin : 2002-08-03 // Begin : 2002-08-03
// Last Update : 2011-05-16 // Last Update : 2011-05-17
// Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com // Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
// License : http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT GNU-LGPLv3 + YOU CAN'T REMOVE ANY TCPDF COPYRIGHT NOTICE OR LINK FROM THE GENERATED PDF DOCUMENTS. // License : http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT GNU-LGPLv3 + YOU CAN'T REMOVE ANY TCPDF COPYRIGHT NOTICE OR LINK FROM THE GENERATED PDF DOCUMENTS.
// ------------------------------------------------------------------- // -------------------------------------------------------------------
@ -134,7 +134,7 @@
* Tools to encode your unicode fonts are on fonts/utils directory.</p> * Tools to encode your unicode fonts are on fonts/utils directory.</p>
* @package com.tecnick.tcpdf * @package com.tecnick.tcpdf
* @author Nicola Asuni * @author Nicola Asuni
* @version 5.9.079 * @version 5.9.080
*/ */
// Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file. // Main configuration file. Define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file.
@ -146,7 +146,7 @@ require_once(dirname(__FILE__).'/config/tcpdf_config.php');
* TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.<br> * TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.<br>
* @package com.tecnick.tcpdf * @package com.tecnick.tcpdf
* @brief PHP class for generating PDF documents without requiring external extensions. * @brief PHP class for generating PDF documents without requiring external extensions.
* @version 5.9.079 * @version 5.9.080
* @author Nicola Asuni - info@tecnick.com * @author Nicola Asuni - info@tecnick.com
*/ */
class TCPDF { class TCPDF {
@ -157,7 +157,7 @@ class TCPDF {
* Current TCPDF version. * Current TCPDF version.
* @private * @private
*/ */
private $tcpdf_version = '5.9.079'; private $tcpdf_version = '5.9.080';
// Protected properties // Protected properties
@ -7261,8 +7261,12 @@ class TCPDF {
// encode spaces on filename (file is probably an URL) // encode spaces on filename (file is probably an URL)
$file = str_replace(' ', '%20', $file); $file = str_replace(' ', '%20', $file);
} }
// get image dimensions if (@file_exists($file)) {
$imsize = @getimagesize($file); // get image dimensions
$imsize = @getimagesize($file);
} else {
$imsize = false;
}
if ($imsize === FALSE) { if ($imsize === FALSE) {
if (function_exists('curl_init')) { if (function_exists('curl_init')) {
// try to get remote file data using cURL // try to get remote file data using cURL
@ -20967,7 +20971,11 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
if (($tag['attribute']['src'][0] == '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) { if (($tag['attribute']['src'][0] == '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
$findroot = strpos($tag['attribute']['src'], $_SERVER['DOCUMENT_ROOT']); $findroot = strpos($tag['attribute']['src'], $_SERVER['DOCUMENT_ROOT']);
if (($findroot === false) OR ($findroot > 1)) { if (($findroot === false) OR ($findroot > 1)) {
$tag['attribute']['src'] = $_SERVER['DOCUMENT_ROOT'].$tag['attribute']['src']; if (substr($_SERVER['DOCUMENT_ROOT'], -1) == '/') {
$tag['attribute']['src'] = substr($_SERVER['DOCUMENT_ROOT'], 0, -1).$tag['attribute']['src'];
} else {
$tag['attribute']['src'] = $_SERVER['DOCUMENT_ROOT'].$tag['attribute']['src'];
}
} }
} }
$tag['attribute']['src'] = urldecode($tag['attribute']['src']); $tag['attribute']['src'] = urldecode($tag['attribute']['src']);
@ -26371,11 +26379,14 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
// replace relative path with full server path // replace relative path with full server path
$img = $this->svgdir.'/'.$img; $img = $this->svgdir.'/'.$img;
} }
if (($img{0} == '/') AND ($_SERVER['DOCUMENT_ROOT'] != '/')) { if (($img[0] == '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
$findroot = strpos($img, $_SERVER['DOCUMENT_ROOT']); $findroot = strpos($img, $_SERVER['DOCUMENT_ROOT']);
if (($findroot === false) OR ($findroot > 1)) { if (($findroot === false) OR ($findroot > 1)) {
// replace relative path with full server path if (substr($_SERVER['DOCUMENT_ROOT'], -1) == '/') {
$img = $_SERVER['DOCUMENT_ROOT'].$img; $img = substr($_SERVER['DOCUMENT_ROOT'], 0, -1).$img;
} else {
$img = $_SERVER['DOCUMENT_ROOT'].$img;
}
} }
} }
$img = urldecode($img); $img = urldecode($img);