mirror of
https://github.com/tecnickcom/TCPDF.git
synced 2025-03-23 23:49:42 +01:00
Merge pull request #319 from Ayesh/curl-hardening
Curl Security: Limit protocols and redirects
This commit is contained in:
commit
f930ac7cea
@ -1842,6 +1842,10 @@ class TCPDF_STATIC {
|
||||
curl_setopt($crs, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($crs, CURLOPT_SSL_VERIFYHOST, false);
|
||||
curl_setopt($crs, CURLOPT_USERAGENT, 'tc-lib-file');
|
||||
curl_setopt($crs, CURLOPT_MAXREDIRS, 5);
|
||||
if (defined('CURLOPT_PROTOCOLS')) {
|
||||
curl_setopt($crs, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS | CURLPROTO_HTTP | CURLPROTO_FTP | CURLPROTO_FTPS);
|
||||
}
|
||||
curl_exec($crs);
|
||||
$code = curl_getinfo($crs, CURLINFO_HTTP_CODE);
|
||||
curl_close($crs);
|
||||
@ -1973,6 +1977,10 @@ class TCPDF_STATIC {
|
||||
curl_setopt($crs, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($crs, CURLOPT_SSL_VERIFYHOST, false);
|
||||
curl_setopt($crs, CURLOPT_USERAGENT, 'tc-lib-file');
|
||||
curl_setopt($crs, CURLOPT_MAXREDIRS, 5);
|
||||
if (defined('CURLOPT_PROTOCOLS')) {
|
||||
curl_setopt($crs, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS | CURLPROTO_HTTP | CURLPROTO_FTP | CURLPROTO_FTPS);
|
||||
}
|
||||
$ret = curl_exec($crs);
|
||||
curl_close($crs);
|
||||
if ($ret !== false) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user