TCPDF update

This commit is contained in:
Roland Gruber 2019-03-24 09:37:16 +01:00
parent 9ba767eb30
commit f85d64aaa4
13 changed files with 634 additions and 235 deletions

View File

@ -13,7 +13,7 @@ Depends: php5 (>= 5.4.26) | php (>= 7), php5-ldap | php-ldap,
php5-json | php-json, php5-curl | php-curl, php5-json | php-json, php5-curl | php-curl,
php5 | php-zip, php5 | php-xml, php5 | php-zip, php5 | php-xml,
libapache2-mod-php5 | libapache2-mod-php | libapache2-mod-fcgid | php5-fpm | php-fpm, libapache2-mod-php5 | libapache2-mod-php | libapache2-mod-fcgid | php5-fpm | php-fpm,
php-tcpdf, php-phpseclib (>= 2.0), php-monolog, php-phpseclib (>= 2.0), php-monolog,
apache2 (>= 2.4.0) | httpd, fonts-dejavu, debconf (>= 0.2.26) | debconf-2.0, ${misc:Depends} apache2 (>= 2.4.0) | httpd, fonts-dejavu, debconf (>= 0.2.26) | debconf-2.0, ${misc:Depends}
Recommends: php-apc | php-opcache Recommends: php-apc | php-opcache
Suggests: ldap-server, php5-mcrypt | php-mcrypt, ldap-account-manager-lamdaemon, perl Suggests: ldap-server, php5-mcrypt | php-mcrypt, ldap-account-manager-lamdaemon, perl

View File

@ -222,10 +222,179 @@ C:
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE. OF THE POSSIBILITY OF SUCH DAMAGE.
D:
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
Programs and licenses with other licenses and/or authors than the Programs and licenses with other licenses and/or authors than the
main license and authors: main license and authors:
lib/3rdParty/tcpdf D 2018 Nicola Asuni - Tecnick.com LTD
lib/3rdParty/tcpdf/fonts/DejaVu*.ttf A Public Domain, Bitstream, Inc., Tavmjong Bah lib/3rdParty/tcpdf/fonts/DejaVu*.ttf A Public Domain, Bitstream, Inc., Tavmjong Bah
lib/3rdParty/tcpdf/fonts/DejaVu*.z A Public Domain, Bitstream, Inc., Tavmjong Bah lib/3rdParty/tcpdf/fonts/DejaVu*.z A Public Domain, Bitstream, Inc., Tavmjong Bah
lib/3rdParty/phpseclib B Jim Wigginton lib/3rdParty/phpseclib B Jim Wigginton

View File

@ -10,7 +10,7 @@ fi
db_version 2.0 || [ $? -lt 30 ] db_version 2.0 || [ $? -lt 30 ]
# 3rd party libs # 3rd party libs
phpThirdPartyLibs='phpseclib tcpdf Monolog Psr' phpThirdPartyLibs='phpseclib Monolog Psr'
for phpThirdPartyLib in $phpThirdPartyLibs; do for phpThirdPartyLib in $phpThirdPartyLibs; do
if [ ! -L /usr/share/ldap-account-manager/lib/3rdParty/${phpThirdPartyLib} ] ; then if [ ! -L /usr/share/ldap-account-manager/lib/3rdParty/${phpThirdPartyLib} ] ; then
ln -s /usr/share/php/${phpThirdPartyLib} /usr/share/ldap-account-manager/lib/3rdParty/${phpThirdPartyLib} ln -s /usr/share/php/${phpThirdPartyLib} /usr/share/ldap-account-manager/lib/3rdParty/${phpThirdPartyLib}

View File

@ -47,6 +47,7 @@ install:
# 3rd party libs are linked # 3rd party libs are linked
install -d --mode=755 debian/ldap-account-manager/usr/share/ldap-account-manager/lib/3rdParty install -d --mode=755 debian/ldap-account-manager/usr/share/ldap-account-manager/lib/3rdParty
install -D --mode=644 lib/3rdParty/yubico/*.php debian/ldap-account-manager/lib/3rdParty/yubico install -D --mode=644 lib/3rdParty/yubico/*.php debian/ldap-account-manager/lib/3rdParty/yubico
install -D --mode=644 lib/3rdParty/tcpdf debian/ldap-account-manager/lib/3rdParty/tcpdf
cp -r locale debian/ldap-account-manager/usr/share/ldap-account-manager/ cp -r locale debian/ldap-account-manager/usr/share/ldap-account-manager/
install -D --mode=644 sess/.htaccess debian/ldap-account-manager/var/lib/ldap-account-manager/sess/.htaccess install -D --mode=644 sess/.htaccess debian/ldap-account-manager/var/lib/ldap-account-manager/sess/.htaccess

View File

@ -221,10 +221,179 @@ C:
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE. OF THE POSSIBILITY OF SUCH DAMAGE.
D:
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
Programs and licenses with other licenses and/or authors than the Programs and licenses with other licenses and/or authors than the
main license and authors: main license and authors:
lib/3rdParty/tcpdf D 2018 Nicola Asuni - Tecnick.com LTD
lib/3rdParty/tcpdf/fonts/DejaVu*.ttf A Public Domain, Bitstream, Inc., Tavmjong Bah lib/3rdParty/tcpdf/fonts/DejaVu*.ttf A Public Domain, Bitstream, Inc., Tavmjong Bah
lib/3rdParty/tcpdf/fonts/DejaVu*.z A Public Domain, Bitstream, Inc., Tavmjong Bah lib/3rdParty/tcpdf/fonts/DejaVu*.z A Public Domain, Bitstream, Inc., Tavmjong Bah
lib/3rdParty/phpseclib B Jim Wigginton lib/3rdParty/phpseclib B Jim Wigginton

View File

@ -1,3 +1,18 @@
6.2.25
- Fix support for image URLs.
6.2.24
- Support remote urls when checking if file exists.
6.2.23
- Simplify file_exists function.
6.2.22
- Fix for security vulnerability: Using the phar:// wrapper it was possible to trigger the unserialization of user provided data.
6.2.19
- Merge various fixes for PHP 7.3 compatibility and security.
6.2.13 (2016-06-10) 6.2.13 (2016-06-10)
- IMPORTANT: A new version of this library is under development at https://github.com/tecnickcom/tc-lib-pdf and as a consequence this version will not receive any additional development or support. This version should be considered obsolete, new projects should use the new version as soon it will become stable. - IMPORTANT: A new version of this library is under development at https://github.com/tecnickcom/tc-lib-pdf and as a consequence this version will not receive any additional development or support. This version should be considered obsolete, new projects should use the new version as soon it will become stable.

View File

@ -6,7 +6,7 @@
* **category** Library * **category** Library
* **author** Nicola Asuni <info@tecnick.com> * **author** Nicola Asuni <info@tecnick.com>
* **copyright** 2002-2016 Nicola Asuni - Tecnick.com LTD * **copyright** 2002-2018 Nicola Asuni - Tecnick.com LTD
* **license** http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT) * **license** http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT)
* **link** http://www.tcpdf.org * **link** http://www.tcpdf.org
* **source** https://github.com/tecnickcom/TCPDF * **source** https://github.com/tecnickcom/TCPDF

View File

@ -1,16 +1,24 @@
{ {
"name": "tecnickcom/tcpdf", "name": "tecnickcom/tcpdf",
"version": "6.2.13", "version": "6.2.26",
"homepage": "http://www.tcpdf.org/", "homepage": "http://www.tcpdf.org/",
"type": "library", "type": "library",
"description": "TCPDF is a PHP class for generating PDF documents and barcodes.", "description": "TCPDF is a PHP class for generating PDF documents and barcodes.",
"keywords": ["PDF","tcpdf","PDFD32000-2008","qrcode","datamatrix","pdf417","barcodes"], "keywords": [
"license": "LGPLv3", "PDF",
"tcpdf",
"PDFD32000-2008",
"qrcode",
"datamatrix",
"pdf417",
"barcodes"
],
"license": "LGPL-3.0",
"authors": [ "authors": [
{ {
"name": "Nicola Asuni", "name": "Nicola Asuni",
"email": "info@tecnick.com", "email": "info@tecnick.com",
"homepage": "http://nicolaasuni.tecnick.com" "role": "lead"
} }
], ],
"require": { "require": {

View File

@ -740,16 +740,6 @@ class PDF417 {
* @protected * @protected
*/ */
protected function getErrorCorrectionLevel($ecl, $numcw) { protected function getErrorCorrectionLevel($ecl, $numcw) {
// get maximum correction level
$maxecl = 8; // starting error level
$maxerrsize = (928 - $numcw); // available codewords for error
while ($maxecl > 0) {
$errsize = (2 << $ecl);
if ($maxerrsize >= $errsize) {
break;
}
--$maxecl;
}
// check for automatic levels // check for automatic levels
if (($ecl < 0) OR ($ecl > 8)) { if (($ecl < 0) OR ($ecl > 8)) {
if ($numcw < 41) { if ($numcw < 41) {
@ -764,6 +754,16 @@ class PDF417 {
$ecl = $maxecl; $ecl = $maxecl;
} }
} }
// get maximum correction level
$maxecl = 8; // starting error level
$maxerrsize = (928 - $numcw); // available codewords for error
while ($maxecl > 0) {
$errsize = (2 << $ecl);
if ($maxerrsize >= $errsize) {
break;
}
--$maxecl;
}
if ($ecl > $maxecl) { if ($ecl > $maxecl) {
$ecl = $maxecl; $ecl = $maxecl;
} }

View File

@ -70,7 +70,7 @@ class TCPDF_FONTS {
* @public static * @public static
*/ */
public static function addTTFfont($fontfile, $fonttype='', $enc='', $flags=32, $outpath='', $platid=3, $encid=1, $addcbbox=false, $link=false) { public static function addTTFfont($fontfile, $fonttype='', $enc='', $flags=32, $outpath='', $platid=3, $encid=1, $addcbbox=false, $link=false) {
if (!file_exists($fontfile)) { if (!TCPDF_STATIC::file_exists($fontfile)) {
// Could not find file // Could not find file
return false; return false;
} }
@ -95,7 +95,7 @@ class TCPDF_FONTS {
$outpath = self::_getfontpath(); $outpath = self::_getfontpath();
} }
// check if this font already exist // check if this font already exist
if (@file_exists($outpath.$font_name.'.php')) { if (@TCPDF_STATIC::file_exists($outpath.$font_name.'.php')) {
// this font already exist (delete it from fonts folder to rebuild it) // this font already exist (delete it from fonts folder to rebuild it)
return $font_name; return $font_name;
} }
@ -665,7 +665,7 @@ class TCPDF_FONTS {
$glyphIdArray[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); $glyphIdArray[$k] = TCPDF_STATIC::_getUSHORT($font, $offset);
$offset += 2; $offset += 2;
} }
for ($k = 0; $k < $segCount; ++$k) { for ($k = 0; $k < $segCount - 1; ++$k) {
for ($c = $startCount[$k]; $c <= $endCount[$k]; ++$c) { for ($c = $startCount[$k]; $c <= $endCount[$k]; ++$c) {
if ($idRangeOffset[$k] == 0) { if ($idRangeOffset[$k] == 0) {
$g = ($idDelta[$k] + $c) % 65536; $g = ($idDelta[$k] + $c) % 65536;
@ -1543,11 +1543,11 @@ class TCPDF_FONTS {
public static function getFontFullPath($file, $fontdir=false) { public static function getFontFullPath($file, $fontdir=false) {
$fontfile = ''; $fontfile = '';
// search files on various directories // search files on various directories
if (($fontdir !== false) AND @file_exists($fontdir.$file)) { if (($fontdir !== false) AND @TCPDF_STATIC::file_exists($fontdir.$file)) {
$fontfile = $fontdir.$file; $fontfile = $fontdir.$file;
} elseif (@file_exists(self::_getfontpath().$file)) { } elseif (@TCPDF_STATIC::file_exists(self::_getfontpath().$file)) {
$fontfile = self::_getfontpath().$file; $fontfile = self::_getfontpath().$file;
} elseif (@file_exists($file)) { } elseif (@TCPDF_STATIC::file_exists($file)) {
$fontfile = $file; $fontfile = $file;
} }
return $fontfile; return $fontfile;
@ -2003,7 +2003,11 @@ class TCPDF_FONTS {
$chars = str_split($str); $chars = str_split($str);
$carr = array_map('ord', $chars); $carr = array_map('ord', $chars);
} }
if (is_array($currentfont['subsetchars']) && is_array($carr)) {
$currentfont['subsetchars'] += array_fill_keys($carr, true); $currentfont['subsetchars'] += array_fill_keys($carr, true);
} else {
$currentfont['subsetchars'] = array_merge($currentfont['subsetchars'], $carr);
}
return $carr; return $carr;
} }

View File

@ -161,12 +161,8 @@ class TCPDF_IMAGES {
*/ */
public static function _parsejpeg($file) { public static function _parsejpeg($file) {
// check if is a local file // check if is a local file
if (!@file_exists($file)) { if (!@TCPDF_STATIC::file_exists($file)) {
// try to encode spaces on filename return false;
$tfile = str_replace(' ', '%20', $file);
if (@file_exists($tfile)) {
$file = $tfile;
}
} }
$a = getimagesize($file); $a = getimagesize($file);
if (empty($a)) { if (empty($a)) {

View File

@ -55,7 +55,7 @@ class TCPDF_STATIC {
* Current TCPDF version. * Current TCPDF version.
* @private static * @private static
*/ */
private static $tcpdf_version = '6.2.13'; private static $tcpdf_version = '6.2.26';
/** /**
* String alias for total number of pages. * String alias for total number of pages.
@ -1774,39 +1774,6 @@ class TCPDF_STATIC {
return $angle; return $angle;
} }
// ====================================================================================================================
// REIMPLEMENTED
// ====================================================================================================================
/** /**
* Split string by a regular expression. * Split string by a regular expression.
* This is a wrapper for the preg_split function to avoid the bug: https://bugs.php.net/bug.php?id=45850 * This is a wrapper for the preg_split function to avoid the bug: https://bugs.php.net/bug.php?id=45850
@ -1854,6 +1821,49 @@ class TCPDF_STATIC {
return fopen($filename, $mode); return fopen($filename, $mode);
} }
/**
* Check if the URL exist.
* @param url (string) URL to check.
* @return Returns TRUE if the URL exists; FALSE otherwise.
* @public static
*/
public static function url_exists($url) {
$crs = curl_init();
curl_setopt($crs, CURLOPT_URL, $url);
curl_setopt($crs, CURLOPT_NOBODY, true);
curl_setopt($crs, CURLOPT_FAILONERROR, true);
if ((ini_get('open_basedir') == '') && (!ini_get('safe_mode'))) {
curl_setopt($crs, CURLOPT_FOLLOWLOCATION, true);
}
curl_setopt($crs, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($crs, CURLOPT_TIMEOUT, 30);
curl_setopt($crs, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($crs, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($crs, CURLOPT_USERAGENT, 'tc-lib-file');
curl_exec($crs);
$code = curl_getinfo($crs, CURLINFO_HTTP_CODE);
curl_close($crs);
return ($code == 200);
}
/**
* Wrapper for file_exists.
* Checks whether a file or directory exists.
* Only allows some protocols and local files.
* @param filename (string) Path to the file or directory.
* @return Returns TRUE if the file or directory specified by filename exists; FALSE otherwise.
* @public static
*/
public static function file_exists($filename) {
if (preg_match('|^https?://|', $filename) == 1) {
return self::url_exists($filename);
}
if (strpos($filename, '://')) {
return false; // only support http and https wrappers for security reasons
}
return @file_exists($filename);
}
/** /**
* Reads entire file into a string. * Reads entire file into a string.
* The file can be also an URL. * The file can be also an URL.
@ -1910,12 +1920,14 @@ class TCPDF_STATIC {
&& !preg_match('%^//%', $file) && !preg_match('%^//%', $file)
) { ) {
$urldata = @parse_url($_SERVER['SCRIPT_URI']); $urldata = @parse_url($_SERVER['SCRIPT_URI']);
return $urldata['scheme'].'://'.$urldata['host'].(($file[0] == '/') ? '' : '/').$file; $alt[] = $urldata['scheme'].'://'.$urldata['host'].(($file[0] == '/') ? '' : '/').$file;
} }
// //
$alt = array_unique($alt); $alt = array_unique($alt);
//var_dump($alt);exit;//DEBUG
foreach ($alt as $path) { foreach ($alt as $path) {
if (!self::file_exists($path)) {
return false;
}
$ret = @file_get_contents($path); $ret = @file_get_contents($path);
if ($ret !== false) { if ($ret !== false) {
return $ret; return $ret;
@ -1949,8 +1961,6 @@ class TCPDF_STATIC {
return false; return false;
} }
/** /**
* Get ULONG from string (Big Endian 32-bit unsigned integer). * Get ULONG from string (Big Endian 32-bit unsigned integer).
* @param $str (string) string from where to extract value * @param $str (string) string from where to extract value

View File

@ -1,13 +1,13 @@
<?php <?php
//============================================================+ //============================================================+
// File name : tcpdf.php // File name : tcpdf.php
// Version : 6.2.13 // Version : 6.2.26
// Begin : 2002-08-03 // Begin : 2002-08-03
// Last Update : 2015-06-18 // Last Update : 2018-09-14
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com // Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html) // License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Copyright (C) 2002-2015 Nicola Asuni - Tecnick.com LTD // Copyright (C) 2002-2018 Nicola Asuni - Tecnick.com LTD
// //
// This file is part of TCPDF software library. // This file is part of TCPDF software library.
// //
@ -104,7 +104,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 6.2.8 * @version 6.2.26
*/ */
// TCPDF configuration // TCPDF configuration
@ -128,8 +128,11 @@ require_once(dirname(__FILE__).'/include/tcpdf_static.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 6.2.8 * @version 6.2.26
* @author Nicola Asuni - info@tecnick.com * @author Nicola Asuni - info@tecnick.com
* @IgnoreAnnotation("protected")
* @IgnoreAnnotation("public")
* @IgnoreAnnotation("pre")
*/ */
class TCPDF { class TCPDF {
@ -1994,10 +1997,6 @@ class TCPDF {
* @since 1.53.0.TC016 * @since 1.53.0.TC016
*/ */
public function __destruct() { public function __destruct() {
// restore internal encoding
if (isset($this->internal_encoding) AND !empty($this->internal_encoding)) {
mb_internal_encoding($this->internal_encoding);
}
// cleanup // cleanup
$this->_destroy(true); $this->_destroy(true);
} }
@ -4257,7 +4256,7 @@ class TCPDF {
// true when the font style variation is missing // true when the font style variation is missing
$missing_style = false; $missing_style = false;
// search and include font file // search and include font file
if (TCPDF_STATIC::empty_string($fontfile) OR (!@file_exists($fontfile))) { if (TCPDF_STATIC::empty_string($fontfile) OR (!@TCPDF_STATIC::file_exists($fontfile))) {
// build a standard filenames for specified font // build a standard filenames for specified font
$tmp_fontfile = str_replace(' ', '', $family).strtolower($style).'.php'; $tmp_fontfile = str_replace(' ', '', $family).strtolower($style).'.php';
$fontfile = TCPDF_FONTS::getFontFullPath($tmp_fontfile, $fontdir); $fontfile = TCPDF_FONTS::getFontFullPath($tmp_fontfile, $fontdir);
@ -4269,7 +4268,7 @@ class TCPDF {
} }
} }
// include font file // include font file
if (!TCPDF_STATIC::empty_string($fontfile) AND (@file_exists($fontfile))) { if (!TCPDF_STATIC::empty_string($fontfile) AND (@TCPDF_STATIC::file_exists($fontfile))) {
include($fontfile); include($fontfile);
} else { } else {
$this->Error('Could not include font definition file: '.$family.''); $this->Error('Could not include font definition file: '.$family.'');
@ -4453,6 +4452,7 @@ class TCPDF {
* @see SetFont() * @see SetFont()
*/ */
public function SetFontSize($size, $out=true) { public function SetFontSize($size, $out=true) {
$size = (float)$size;
// font size in points // font size in points
$this->FontSizePt = $size; $this->FontSizePt = $size;
// font size in user units // font size in user units
@ -4809,19 +4809,19 @@ class TCPDF {
$this->PageAnnots[$page][] = array('n' => ++$this->n, 'x' => $x, 'y' => $y, 'w' => $w, 'h' => $h, 'txt' => $text, 'opt' => $opt, 'numspaces' => $spaces); $this->PageAnnots[$page][] = array('n' => ++$this->n, 'x' => $x, 'y' => $y, 'w' => $w, 'h' => $h, 'txt' => $text, 'opt' => $opt, 'numspaces' => $spaces);
if (!$this->pdfa_mode) { if (!$this->pdfa_mode) {
if ((($opt['Subtype'] == 'FileAttachment') OR ($opt['Subtype'] == 'Sound')) AND (!TCPDF_STATIC::empty_string($opt['FS'])) if ((($opt['Subtype'] == 'FileAttachment') OR ($opt['Subtype'] == 'Sound')) AND (!TCPDF_STATIC::empty_string($opt['FS']))
AND (@file_exists($opt['FS']) OR TCPDF_STATIC::isValidURL($opt['FS'])) AND (@TCPDF_STATIC::file_exists($opt['FS']) OR TCPDF_STATIC::isValidURL($opt['FS']))
AND (!isset($this->embeddedfiles[basename($opt['FS'])]))) { AND (!isset($this->embeddedfiles[basename($opt['FS'])]))) {
$this->embeddedfiles[basename($opt['FS'])] = array('f' => ++$this->n, 'n' => ++$this->n, 'file' => $opt['FS']); $this->embeddedfiles[basename($opt['FS'])] = array('f' => ++$this->n, 'n' => ++$this->n, 'file' => $opt['FS']);
} }
} }
// Add widgets annotation's icons // Add widgets annotation's icons
if (isset($opt['mk']['i']) AND @file_exists($opt['mk']['i'])) { if (isset($opt['mk']['i']) AND @TCPDF_STATIC::file_exists($opt['mk']['i'])) {
$this->Image($opt['mk']['i'], '', '', 10, 10, '', '', '', false, 300, '', false, false, 0, false, true); $this->Image($opt['mk']['i'], '', '', 10, 10, '', '', '', false, 300, '', false, false, 0, false, true);
} }
if (isset($opt['mk']['ri']) AND @file_exists($opt['mk']['ri'])) { if (isset($opt['mk']['ri']) AND @TCPDF_STATIC::file_exists($opt['mk']['ri'])) {
$this->Image($opt['mk']['ri'], '', '', 0, 0, '', '', '', false, 300, '', false, false, 0, false, true); $this->Image($opt['mk']['ri'], '', '', 0, 0, '', '', '', false, 300, '', false, false, 0, false, true);
} }
if (isset($opt['mk']['ix']) AND @file_exists($opt['mk']['ix'])) { if (isset($opt['mk']['ix']) AND @TCPDF_STATIC::file_exists($opt['mk']['ix'])) {
$this->Image($opt['mk']['ix'], '', '', 0, 0, '', '', '', false, 300, '', false, false, 0, false, true); $this->Image($opt['mk']['ix'], '', '', 0, 0, '', '', '', false, 300, '', false, false, 0, false, true);
} }
} }
@ -5769,10 +5769,9 @@ class TCPDF {
$this->resetLastH(); $this->resetLastH();
} }
if (!TCPDF_STATIC::empty_string($y)) { if (!TCPDF_STATIC::empty_string($y)) {
$this->SetY($y); $this->SetY($y); // set y in order to convert negative y values to positive ones
} else {
$y = $this->GetY();
} }
$y = $this->GetY();
$resth = 0; $resth = 0;
if (($h > 0) AND $this->inPageBody() AND (($y + $h + $mc_margin['T'] + $mc_margin['B']) > $this->PageBreakTrigger)) { if (($h > 0) AND $this->inPageBody() AND (($y + $h + $mc_margin['T'] + $mc_margin['B']) > $this->PageBreakTrigger)) {
// spit cell in more pages/columns // spit cell in more pages/columns
@ -6845,13 +6844,9 @@ class TCPDF {
$file = substr($file, 1); $file = substr($file, 1);
$exurl = $file; $exurl = $file;
} }
// check if is a local file // check if file exist and it is valid
if (!@file_exists($file)) { if (!@TCPDF_STATIC::file_exists($file)) {
// try to encode spaces on filename return false;
$tfile = str_replace(' ', '%20', $file);
if (@file_exists($tfile)) {
$file = $tfile;
}
} }
if (($imsize = @getimagesize($file)) === FALSE) { if (($imsize = @getimagesize($file)) === FALSE) {
if (in_array($file, $this->imagekeys)) { if (in_array($file, $this->imagekeys)) {
@ -7750,6 +7745,10 @@ class TCPDF {
* @since 4.5.016 (2009-02-24) * @since 4.5.016 (2009-02-24)
*/ */
public function _destroy($destroyall=false, $preserve_objcopy=false) { public function _destroy($destroyall=false, $preserve_objcopy=false) {
// restore internal encoding
if (isset($this->internal_encoding) AND !empty($this->internal_encoding)) {
mb_internal_encoding($this->internal_encoding);
}
if ($destroyall AND !$preserve_objcopy) { if ($destroyall AND !$preserve_objcopy) {
// remove all temporary files // remove all temporary files
$tmpfiles = glob(K_PATH_CACHE.'__tcpdf_'.$this->file_id.'_*'); $tmpfiles = glob(K_PATH_CACHE.'__tcpdf_'.$this->file_id.'_*');
@ -8157,7 +8156,9 @@ class TCPDF {
$annots .= ' /FT /'.$pl['opt']['ft']; $annots .= ' /FT /'.$pl['opt']['ft'];
$formfield = true; $formfield = true;
} }
if ($pl['opt']['subtype'] !== 'Link') {
$annots .= ' /Contents '.$this->_textstring($pl['txt'], $annot_obj_id); $annots .= ' /Contents '.$this->_textstring($pl['txt'], $annot_obj_id);
}
$annots .= ' /P '.$this->page_obj_id[$n].' 0 R'; $annots .= ' /P '.$this->page_obj_id[$n].' 0 R';
$annots .= ' /NM '.$this->_datastring(sprintf('%04u-%04u', $n, $key), $annot_obj_id); $annots .= ' /NM '.$this->_datastring(sprintf('%04u-%04u', $n, $key), $annot_obj_id);
$annots .= ' /M '.$this->_datestring($annot_obj_id, $this->doc_modification_timestamp); $annots .= ' /M '.$this->_datestring($annot_obj_id, $this->doc_modification_timestamp);
@ -9646,7 +9647,7 @@ class TCPDF {
protected function _putcatalog() { protected function _putcatalog() {
// put XMP // put XMP
$xmpobj = $this->_putXMP(); $xmpobj = $this->_putXMP();
// if required, add standard sRGB_IEC61966-2.1 blackscaled ICC colour profile // if required, add standard sRGB ICC colour profile
if ($this->pdfa_mode OR $this->force_srgb) { if ($this->pdfa_mode OR $this->force_srgb) {
$iccobj = $this->_newobj(); $iccobj = $this->_newobj();
$icc = file_get_contents(dirname(__FILE__).'/include/sRGB.icc'); $icc = file_get_contents(dirname(__FILE__).'/include/sRGB.icc');
@ -12582,7 +12583,7 @@ class TCPDF {
$k = $this->k; $k = $this->k;
$this->javascript .= sprintf("f".$name."=this.addField('%s','%s',%u,[%F,%F,%F,%F]);", $name, $type, $this->PageNo()-1, $x*$k, ($this->h-$y)*$k+1, ($x+$w)*$k, ($this->h-$y-$h)*$k+1)."\n"; $this->javascript .= sprintf("f".$name."=this.addField('%s','%s',%u,[%F,%F,%F,%F]);", $name, $type, $this->PageNo()-1, $x*$k, ($this->h-$y)*$k+1, ($x+$w)*$k, ($this->h-$y-$h)*$k+1)."\n";
$this->javascript .= 'f'.$name.'.textSize='.$this->FontSizePt.";\n"; $this->javascript .= 'f'.$name.'.textSize='.$this->FontSizePt.";\n";
while (list($key, $val) = each($prop)) { foreach($prop as $key => $val) {
if (strcmp(substr($key, -5), 'Color') == 0) { if (strcmp(substr($key, -5), 'Color') == 0) {
$val = TCPDF_COLORS::_JScolor($val); $val = TCPDF_COLORS::_JScolor($val);
} else { } else {
@ -15190,7 +15191,7 @@ class TCPDF {
* @since 3.1.000 (2008-06-09) * @since 3.1.000 (2008-06-09)
* @public * @public
*/ */
public function write1DBarcode($code, $type, $x='', $y='', $w='', $h='', $xres='', $style='', $align='') { public function write1DBarcode($code, $type, $x='', $y='', $w='', $h='', $xres='', $style=array(), $align='') {
if (TCPDF_STATIC::empty_string(trim($code))) { if (TCPDF_STATIC::empty_string(trim($code))) {
return; return;
} }
@ -15509,7 +15510,7 @@ class TCPDF {
* @since 4.5.037 (2009-04-07) * @since 4.5.037 (2009-04-07)
* @public * @public
*/ */
public function write2DBarcode($code, $type, $x='', $y='', $w='', $h='', $style='', $align='', $distort=false) { public function write2DBarcode($code, $type, $x='', $y='', $w='', $h='', $style=array(), $align='', $distort=false) {
if (TCPDF_STATIC::empty_string(trim($code))) { if (TCPDF_STATIC::empty_string(trim($code))) {
return; return;
} }
@ -16545,7 +16546,7 @@ class TCPDF {
// get attributes // get attributes
preg_match_all('/([^=\s]*)[\s]*=[\s]*"([^"]*)"/', $element, $attr_array, PREG_PATTERN_ORDER); preg_match_all('/([^=\s]*)[\s]*=[\s]*"([^"]*)"/', $element, $attr_array, PREG_PATTERN_ORDER);
$dom[$key]['attribute'] = array(); // reset attribute array $dom[$key]['attribute'] = array(); // reset attribute array
while (list($id, $name) = each($attr_array[1])) { foreach($attr_array[1] as $id => $name) {
$dom[$key]['attribute'][strtolower($name)] = $attr_array[2][$id]; $dom[$key]['attribute'][strtolower($name)] = $attr_array[2][$id];
} }
if (!empty($css)) { if (!empty($css)) {
@ -16558,7 +16559,7 @@ class TCPDF {
// get style attributes // get style attributes
preg_match_all('/([^;:\s]*):([^;]*)/', $dom[$key]['attribute']['style'], $style_array, PREG_PATTERN_ORDER); preg_match_all('/([^;:\s]*):([^;]*)/', $dom[$key]['attribute']['style'], $style_array, PREG_PATTERN_ORDER);
$dom[$key]['style'] = array(); // reset style attribute array $dom[$key]['style'] = array(); // reset style attribute array
while (list($id, $name) = each($style_array[1])) { foreach($style_array[1] as $id => $name) {
// in case of duplicate attribute the last replace the previous // in case of duplicate attribute the last replace the previous
$dom[$key]['style'][strtolower($name)] = trim($style_array[2][$id]); $dom[$key]['style'][strtolower($name)] = trim($style_array[2][$id]);
} }
@ -17176,10 +17177,10 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
if ($cell) { if ($cell) {
if ($this->rtl) { if ($this->rtl) {
$this->x -= $this->cell_padding['R']; $this->x -= $this->cell_padding['R'];
$this->lMargin += $this->cell_padding['R']; $this->lMargin += $this->cell_padding['L'];
} else { } else {
$this->x += $this->cell_padding['L']; $this->x += $this->cell_padding['L'];
$this->rMargin += $this->cell_padding['L']; $this->rMargin += $this->cell_padding['R'];
} }
} }
if ($this->customlistindent >= 0) { if ($this->customlistindent >= 0) {
@ -17781,7 +17782,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
// justify block // justify block
if (!TCPDF_STATIC::empty_string($this->lispacer)) { if (!TCPDF_STATIC::empty_string($this->lispacer)) {
$this->lispacer = ''; $this->lispacer = '';
continue; break;
} }
preg_match('/([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]('.$strpiece[1][0].')[\s](re)([\s]*)/x', $pmid, $xmatches); preg_match('/([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]('.$strpiece[1][0].')[\s](re)([\s]*)/x', $pmid, $xmatches);
if (!isset($xmatches[1])) { if (!isset($xmatches[1])) {
@ -18316,7 +18317,8 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
} }
// text // text
$this->htmlvspace = 0; $this->htmlvspace = 0;
if ((!$this->premode) AND $this->isRTLTextDir()) { $isRTLString = preg_match(TCPDF_FONT_DATA::$uni_RE_PATTERN_RTL, $dom[$key]['value']) || preg_match(TCPDF_FONT_DATA::$uni_RE_PATTERN_ARABIC, $dom[$key]['value']);
if ((!$this->premode) AND $this->isRTLTextDir() AND !$isRTLString) {
// reverse spaces order // reverse spaces order
$lsp = ''; // left spaces $lsp = ''; // left spaces
$rsp = ''; // right spaces $rsp = ''; // right spaces
@ -18331,7 +18333,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
if ($newline) { if ($newline) {
if (!$this->premode) { if (!$this->premode) {
$prelen = strlen($dom[$key]['value']); $prelen = strlen($dom[$key]['value']);
if ($this->isRTLTextDir()) { if ($this->isRTLTextDir() AND !$isRTLString) {
// right trim except non-breaking space // right trim except non-breaking space
$dom[$key]['value'] = $this->stringRightTrim($dom[$key]['value']); $dom[$key]['value'] = $this->stringRightTrim($dom[$key]['value']);
} else { } else {
@ -18815,14 +18817,37 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
break; break;
} }
case 'img': { case 'img': {
if (!empty($tag['attribute']['src'])) { if (empty($tag['attribute']['src'])) {
if ($tag['attribute']['src'][0] === '@') { break;
}
$imgsrc = $tag['attribute']['src'];
if ($imgsrc[0] === '@') {
// data stream // data stream
$tag['attribute']['src'] = '@'.base64_decode(substr($tag['attribute']['src'], 1)); $imgsrc = '@'.base64_decode(substr($imgsrc, 1));
$type = ''; $type = '';
} else { } else {
if (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
// fix image path
$findroot = strpos($imgsrc, $_SERVER['DOCUMENT_ROOT']);
if (($findroot === false) OR ($findroot > 1)) {
if (substr($_SERVER['DOCUMENT_ROOT'], -1) == '/') {
$imgsrc = substr($_SERVER['DOCUMENT_ROOT'], 0, -1).$imgsrc;
} else {
$imgsrc = $_SERVER['DOCUMENT_ROOT'].$imgsrc;
}
}
$imgsrc = urldecode($imgsrc);
$testscrtype = @parse_url($imgsrc);
if (empty($testscrtype['query'])) {
// convert URL to server path
$imgsrc = str_replace(K_PATH_URL, K_PATH_MAIN, $imgsrc);
} elseif (preg_match('|^https?://|', $imgsrc) !== 1) {
// convert URL to server path
$imgsrc = str_replace(K_PATH_MAIN, K_PATH_URL, $imgsrc);
}
}
// get image type // get image type
$type = TCPDF_IMAGES::getImageFileType($tag['attribute']['src']); $type = TCPDF_IMAGES::getImageFileType($imgsrc);
} }
if (!isset($tag['width'])) { if (!isset($tag['width'])) {
$tag['width'] = 0; $tag['width'] = 0;
@ -18890,11 +18915,11 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$ih = $this->getHTMLUnitToUnits($tag['height'], ($tag['fontsize'] / $this->k), 'px', false); $ih = $this->getHTMLUnitToUnits($tag['height'], ($tag['fontsize'] / $this->k), 'px', false);
} }
if (($type == 'eps') OR ($type == 'ai')) { if (($type == 'eps') OR ($type == 'ai')) {
$this->ImageEps($tag['attribute']['src'], $xpos, $this->y, $iw, $ih, $imglink, true, $align, '', $border, true); $this->ImageEps($imgsrc, $xpos, $this->y, $iw, $ih, $imglink, true, $align, '', $border, true);
} elseif ($type == 'svg') { } elseif ($type == 'svg') {
$this->ImageSVG($tag['attribute']['src'], $xpos, $this->y, $iw, $ih, $imglink, $align, '', $border, true); $this->ImageSVG($imgsrc, $xpos, $this->y, $iw, $ih, $imglink, $align, '', $border, true);
} else { } else {
$this->Image($tag['attribute']['src'], $xpos, $this->y, $iw, $ih, '', $imglink, $align, false, 300, '', false, false, $border, false, false, true); $this->Image($imgsrc, $xpos, $this->y, $iw, $ih, '', $imglink, $align, false, 300, '', false, false, $border, false, false, true);
} }
switch($align) { switch($align) {
case 'T': { case 'T': {
@ -18910,7 +18935,6 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
break; break;
} }
} }
}
break; break;
} }
case 'dl': { case 'dl': {
@ -21511,7 +21535,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
} else { } else {
// placemark to be replaced with the correct number // placemark to be replaced with the correct number
$pagenum = '{#'.($outline['p']).'}'; $pagenum = '{#'.($outline['p']).'}';
if ($templates['F'.$outline['l']]) { if (isset($templates['F'.$outline['l']]) && $templates['F'.$outline['l']]) {
$pagenum = '{'.$pagenum.'}'; $pagenum = '{'.$pagenum.'}';
} }
$maxpage = max($maxpage, $outline['p']); $maxpage = max($maxpage, $outline['p']);
@ -24204,9 +24228,12 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
} }
$img = urldecode($img); $img = urldecode($img);
$testscrtype = @parse_url($img); $testscrtype = @parse_url($img);
if (!isset($testscrtype['query']) OR empty($testscrtype['query'])) { if (empty($testscrtype['query'])) {
// convert URL to server path // convert URL to server path
$img = str_replace(K_PATH_URL, K_PATH_MAIN, $img); $img = str_replace(K_PATH_URL, K_PATH_MAIN, $img);
} elseif (preg_match('|^https?://|', $img) !== 1) {
// convert server path to URL
$img = str_replace(K_PATH_MAIN, K_PATH_URL, $img);
} }
} }
// get image type // get image type