forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-70294 libraries: upgrade to version 6.3.5 of TCPDF.
- Loading branch information
1 parent
c381757
commit b559600
Showing
4 changed files
with
63 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
|
||
* **category** Library | ||
* **author** Nicola Asuni <[email protected]> | ||
* **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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 - [email protected] | ||
// 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 @@ public static function fopenLocal($filename, $mode) { | |
*/ | ||
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 @@ public static function url_exists($url) { | |
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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters