mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 12:32:08 +02:00
MDL-70294 libraries: upgrade to version 6.3.5 of TCPDF.
This commit is contained in:
parent
c381757f2a
commit
b559600219
@ -6,7 +6,7 @@
|
||||
|
||||
* **category** Library
|
||||
* **author** Nicola Asuni <info@tecnick.com>
|
||||
* **copyright** 2002-2019 Nicola Asuni - Tecnick.com LTD
|
||||
* **copyright** 2002-2020 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
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "tecnickcom/tcpdf",
|
||||
"version": "6.3.2",
|
||||
"version": "6.3.5",
|
||||
"homepage": "http://www.tcpdf.org/",
|
||||
"type": "library",
|
||||
"description": "TCPDF is a PHP class for generating PDF documents and barcodes.",
|
||||
@ -13,7 +13,7 @@
|
||||
"pdf417",
|
||||
"barcodes"
|
||||
],
|
||||
"license": "LGPL-3.0",
|
||||
"license": "LGPL-3.0-only",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicola Asuni",
|
||||
|
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
//============================================================+
|
||||
// File name : tcpdf_static.php
|
||||
// Version : 1.1.3
|
||||
// Version : 1.1.4
|
||||
// Begin : 2002-08-03
|
||||
// Last Update : 2015-04-28
|
||||
// Last Update : 2019-11-01
|
||||
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
|
||||
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
|
||||
// -------------------------------------------------------------------
|
||||
@ -55,7 +55,7 @@ class TCPDF_STATIC {
|
||||
* Current TCPDF version.
|
||||
* @private static
|
||||
*/
|
||||
private static $tcpdf_version = '6.3.2';
|
||||
private static $tcpdf_version = '6.3.5';
|
||||
|
||||
/**
|
||||
* String alias for total number of pages.
|
||||
@ -1829,6 +1829,8 @@ class TCPDF_STATIC {
|
||||
*/
|
||||
public static function url_exists($url) {
|
||||
$crs = curl_init();
|
||||
// encode query params in URL to get right response form the server
|
||||
$url = self::encodeUrlQuery($url);
|
||||
curl_setopt($crs, CURLOPT_URL, $url);
|
||||
curl_setopt($crs, CURLOPT_NOBODY, true);
|
||||
curl_setopt($crs, CURLOPT_FAILONERROR, true);
|
||||
@ -1846,6 +1848,26 @@ class TCPDF_STATIC {
|
||||
return ($code == 200);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode query params in URL
|
||||
*
|
||||
* @param string $url
|
||||
* @return string
|
||||
* @since 6.3.3 (2019-11-01)
|
||||
* @public static
|
||||
*/
|
||||
public static function encodeUrlQuery($url) {
|
||||
$urlData = parse_url($url);
|
||||
if (isset($urlData['query']) && $urlData['query']) {
|
||||
$urlQueryData = [];
|
||||
parse_str(urldecode($urlData['query']), $urlQueryData);
|
||||
$updatedUrl = $urlData['scheme'] . '://' . $urlData['host'] . $urlData['path'] . '?' . http_build_query($urlQueryData);
|
||||
} else {
|
||||
$updatedUrl = $url;
|
||||
}
|
||||
return $updatedUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper for file_exists.
|
||||
* Checks whether a file or directory exists.
|
||||
|
@ -4722,7 +4722,7 @@ class TCPDF {
|
||||
*/
|
||||
public function SetLink($link, $y=0, $page=-1) {
|
||||
$fixed = false;
|
||||
if (!empty($page) AND is_string($page) AND ($page[0] == '*')) {
|
||||
if (!empty($page) AND (substr($page, 0, 1) == '*')) {
|
||||
$page = intval(substr($page, 1));
|
||||
// this page number will not be changed when moving/add/deleting pages
|
||||
$fixed = true;
|
||||
@ -7165,31 +7165,20 @@ class TCPDF {
|
||||
$info['i'] = $this->setImageBuffer($file, $info);
|
||||
}
|
||||
// set alignment
|
||||
$this->img_rb_x = $x + $w;
|
||||
$this->img_rb_y = $y + $h;
|
||||
|
||||
// set alignment
|
||||
if ($this->rtl) {
|
||||
if ($palign == 'L') {
|
||||
$ximg = $this->lMargin;
|
||||
} elseif ($palign == 'C') {
|
||||
$ximg = ($this->w + $this->lMargin - $this->rMargin - $w) / 2;
|
||||
} elseif ($palign == 'R') {
|
||||
$ximg = $this->w - $this->rMargin - $w;
|
||||
} else {
|
||||
$ximg = $x - $w;
|
||||
}
|
||||
$this->img_rb_x = $ximg;
|
||||
if ($palign == 'L') {
|
||||
$ximg = $this->lMargin;
|
||||
} elseif ($palign == 'C') {
|
||||
$ximg = ($this->w + $this->lMargin - $this->rMargin - $w) / 2;
|
||||
} elseif ($palign == 'R') {
|
||||
$ximg = $this->w - $this->rMargin - $w;
|
||||
} else {
|
||||
if ($palign == 'L') {
|
||||
$ximg = $this->lMargin;
|
||||
} elseif ($palign == 'C') {
|
||||
$ximg = ($this->w + $this->lMargin - $this->rMargin - $w) / 2;
|
||||
} elseif ($palign == 'R') {
|
||||
$ximg = $this->w - $this->rMargin - $w;
|
||||
} else {
|
||||
$ximg = $x;
|
||||
}
|
||||
$this->img_rb_x = $ximg + $w;
|
||||
$ximg = $x;
|
||||
}
|
||||
|
||||
if ($ismask OR $hidden) {
|
||||
// image is not displayed
|
||||
return $info['i'];
|
||||
@ -7799,7 +7788,7 @@ class TCPDF {
|
||||
if (isset($this->imagekeys)) {
|
||||
foreach($this->imagekeys as $file) {
|
||||
if (strpos($file, K_PATH_CACHE) === 0) {
|
||||
unlink($file);
|
||||
@unlink($file);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -7811,6 +7800,7 @@ class TCPDF {
|
||||
'bufferlen',
|
||||
'buffer',
|
||||
'cached_files',
|
||||
'imagekeys',
|
||||
'sign',
|
||||
'signature_data',
|
||||
'signature_max_length',
|
||||
@ -9640,6 +9630,16 @@ class TCPDF {
|
||||
$xmp .= "\t\t\t\t\t\t".'<pdfaSchema:namespaceURI>http://ns.adobe.com/pdf/1.3/</pdfaSchema:namespaceURI>'."\n";
|
||||
$xmp .= "\t\t\t\t\t\t".'<pdfaSchema:prefix>pdf</pdfaSchema:prefix>'."\n";
|
||||
$xmp .= "\t\t\t\t\t\t".'<pdfaSchema:schema>Adobe PDF Schema</pdfaSchema:schema>'."\n";
|
||||
$xmp .= "\t\t\t\t\t\t".'<pdfaSchema:property>'."\n";
|
||||
$xmp .= "\t\t\t\t\t\t\t".'<rdf:Seq>'."\n";
|
||||
$xmp .= "\t\t\t\t\t\t\t\t".'<rdf:li rdf:parseType="Resource">'."\n";
|
||||
$xmp .= "\t\t\t\t\t\t\t\t\t".'<pdfaProperty:category>internal</pdfaProperty:category>'."\n";
|
||||
$xmp .= "\t\t\t\t\t\t\t\t\t".'<pdfaProperty:description>Adobe PDF Schema</pdfaProperty:description>'."\n";
|
||||
$xmp .= "\t\t\t\t\t\t\t\t\t".'<pdfaProperty:name>InstanceID</pdfaProperty:name>'."\n";
|
||||
$xmp .= "\t\t\t\t\t\t\t\t\t".'<pdfaProperty:valueType>URI</pdfaProperty:valueType>'."\n";
|
||||
$xmp .= "\t\t\t\t\t\t\t\t".'</rdf:li>'."\n";
|
||||
$xmp .= "\t\t\t\t\t\t\t".'</rdf:Seq>'."\n";
|
||||
$xmp .= "\t\t\t\t\t\t".'</pdfaSchema:property>'."\n";
|
||||
$xmp .= "\t\t\t\t\t".'</rdf:li>'."\n";
|
||||
$xmp .= "\t\t\t\t\t".'<rdf:li rdf:parseType="Resource">'."\n";
|
||||
$xmp .= "\t\t\t\t\t\t".'<pdfaSchema:namespaceURI>http://ns.adobe.com/xap/1.0/mm/</pdfaSchema:namespaceURI>'."\n";
|
||||
@ -12281,7 +12281,7 @@ class TCPDF {
|
||||
$x = $this->w;
|
||||
}
|
||||
$fixed = false;
|
||||
if (!empty($page) AND ($page[0] == '*')) {
|
||||
if (!empty($page) AND (substr($page, 0, 1) == '*')) {
|
||||
$page = intval(substr($page, 1));
|
||||
// this page number will not be changed when moving/add/deleting pages
|
||||
$fixed = true;
|
||||
@ -12384,7 +12384,8 @@ class TCPDF {
|
||||
$x = $this->w;
|
||||
}
|
||||
$fixed = false;
|
||||
if (!empty($page) AND ($page[0] == '*')) {
|
||||
$pageAsString = (string) $page;
|
||||
if ($pageAsString && $pageAsString[0] == '*') {
|
||||
$page = intval(substr($page, 1));
|
||||
// this page number will not be changed when moving/add/deleting pages
|
||||
$fixed = true;
|
||||
@ -23408,7 +23409,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
|
||||
*/
|
||||
protected function SVGPath($d, $style='') {
|
||||
if ($this->state != 2) {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
// set fill/stroke style
|
||||
$op = TCPDF_STATIC::getPathPaintOperator($style, '');
|
||||
@ -23428,6 +23429,8 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
|
||||
$xmax = 0;
|
||||
$ymin = 2147483647;
|
||||
$ymax = 0;
|
||||
$xinitial = 0;
|
||||
$yinitial = 0;
|
||||
$relcoord = false;
|
||||
$minlen = (0.01 / $this->k); // minimum acceptable length (3 point)
|
||||
$firstcmd = true; // used to print first point
|
||||
@ -23472,6 +23475,8 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
|
||||
if ($ck == 1) {
|
||||
$this->_outPoint($x, $y);
|
||||
$firstcmd = false;
|
||||
$xinitial = $x;
|
||||
$yinitial = $y;
|
||||
} else {
|
||||
$this->_outLine($x, $y);
|
||||
}
|
||||
@ -23659,8 +23664,8 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
|
||||
if ((($ck + 1) % 7) == 0) {
|
||||
$x0 = $x;
|
||||
$y0 = $y;
|
||||
$rx = abs($params[($ck - 6)]);
|
||||
$ry = abs($params[($ck - 5)]);
|
||||
$rx = max(abs($params[($ck - 6)]), .000000001);
|
||||
$ry = max(abs($params[($ck - 5)]), .000000001);
|
||||
$ang = -$rawparams[($ck - 4)];
|
||||
$angle = deg2rad($ang);
|
||||
$fa = $rawparams[($ck - 3)]; // large-arc-flag
|
||||
@ -23747,6 +23752,8 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
|
||||
}
|
||||
case 'Z': {
|
||||
$this->_out('h');
|
||||
$x = $x0 = $xinitial;
|
||||
$y = $y0 = $yinitial;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user