Skip to content

Commit

Permalink
MDL-66966 tcpdf: Bump to tcpdf 6.3.2
Browse files Browse the repository at this point in the history
Bug fixes and php74 support.
  • Loading branch information
stronk7 committed Nov 22, 2019
1 parent a5f618d commit fe503a3
Show file tree
Hide file tree
Showing 14 changed files with 172 additions and 191 deletions.
2 changes: 2 additions & 0 deletions lib/tcpdf/LICENSE.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

2002-2019 Nicola Asuni - Tecnick.com LTD

**********************************************************************
**********************************************************************
Expand Down
84 changes: 0 additions & 84 deletions lib/tcpdf/README.TXT

This file was deleted.

2 changes: 1 addition & 1 deletion lib/tcpdf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

* **category** Library
* **author** Nicola Asuni <[email protected]>
* **copyright** 2002-2018 Nicola Asuni - Tecnick.com LTD
* **copyright** 2002-2019 Nicola Asuni - Tecnick.com LTD
* **license** http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT)
* **link** http://www.tcpdf.org
* **source** https://github.com/tecnickcom/TCPDF
Expand Down
2 changes: 1 addition & 1 deletion lib/tcpdf/composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tecnickcom/tcpdf",
"version": "6.2.26",
"version": "6.3.2",
"homepage": "http://www.tcpdf.org/",
"type": "library",
"description": "TCPDF is a PHP class for generating PDF documents and barcodes.",
Expand Down
2 changes: 1 addition & 1 deletion lib/tcpdf/include/tcpdf_colors.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ public static function convertHTMLColorToDec($hcolor, &$spotc, $defcol=array('R'
$color_code = self::$webcolor[$color];
} else {
// spot color
$returncolor = self::getSpotColor($color, $spotc);
$returncolor = self::getSpotColor($hcolor, $spotc);
if ($returncolor === false) {
$returncolor = $defcol;
}
Expand Down
6 changes: 3 additions & 3 deletions lib/tcpdf/include/tcpdf_filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ public static function decodeFilterLZWDecode($data) {
// convert string to binary string
$bitstring = '';
for ($i = 0; $i < $data_length; ++$i) {
$bitstring .= sprintf('%08b', ord($data{$i}));
$bitstring .= sprintf('%08b', ord($data[$i]));
}
// get the number of bits
$data_length = strlen($bitstring);
Expand Down Expand Up @@ -376,7 +376,7 @@ public static function decodeFilterRunLengthDecode($data) {
$i = 0;
while($i < $data_length) {
// get current byte value
$byte = ord($data{$i});
$byte = ord($data[$i]);
if ($byte == 128) {
// a length value of 128 denote EOD
break;
Expand All @@ -389,7 +389,7 @@ public static function decodeFilterRunLengthDecode($data) {
} else {
// if length is in the range 129 to 255,
// the following single byte shall be copied 257 - length (2 to 128) times during decompression
$decoded .= str_repeat($data{($i + 1)}, (257 - $byte));
$decoded .= str_repeat($data[($i + 1)], (257 - $byte));
// move to next block
$i += 2;
}
Expand Down
1 change: 1 addition & 0 deletions lib/tcpdf/include/tcpdf_fonts.php
Original file line number Diff line number Diff line change
Expand Up @@ -1664,6 +1664,7 @@ public static function getFontRefSize($size, $refsize=12) {
* @public static
*/
public static function unichr($c, $unicode=true) {
$c = intval($c);
if (!$unicode) {
return chr($c);
} elseif ($c <= 0x7F) {
Expand Down
2 changes: 1 addition & 1 deletion lib/tcpdf/include/tcpdf_images.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ public static function _parsepng($file) {
if ($n > 0) {
$trns = array();
for ($i = 0; $i < $n; ++ $i) {
$trns[] = ord($t{$i});
$trns[] = ord($t[$i]);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions lib/tcpdf/include/tcpdf_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class TCPDF_STATIC {
* Current TCPDF version.
* @private static
*/
private static $tcpdf_version = '6.2.26';
private static $tcpdf_version = '6.3.2';

/**
* String alias for total number of pages.
Expand Down Expand Up @@ -1926,10 +1926,10 @@ public static function fileGetContents($file) {
$alt = array_unique($alt);
foreach ($alt as $path) {
if (!self::file_exists($path)) {
return false;
continue;
}
$ret = @file_get_contents($path);
if ($ret !== false) {
if ( $ret != false ) {
return $ret;
}
// try to use CURL for URLs
Expand Down
9 changes: 7 additions & 2 deletions lib/tcpdf/readme_moodle.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Description of TCPDF library import 6.2.26
Description of TCPDF library import 6.3.2
==========================================
* download library from https://github.com/tecnickcom/TCPDF/releases
* delete examples/, tools/ and tcpdf_import.php
* delete examples/, tools/ VERSION and tcpdf_import.php
* remove tcpdf_import.php from composer.json
* remove all fonts that were not already present
* visit http://127.0.0.1/lib/tests/other/pdflibtestpage.php and view the pdf
Expand All @@ -11,6 +11,11 @@ Important
A new version of the libray is being developed @ https://github.com/tecnickcom/tc-lib-pdf . Check periodically when it's ready
and if it's a drop-in replacement for the legacy tcpdf one.

2019/10/20
----------
Upgrade to tcpdf TCPDF 6.3.2 (MDL-66966)
by Eloy Lafuente <[email protected]>

2019/05/06
----------
Upgrade to tcpdf TCPDF 6.2.26 (MDL-64794)
Expand Down
Loading

0 comments on commit fe503a3

Please sign in to comment.