mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-01-24 23:58:29 +00:00
X509: add methods to enable / disable URL fetching
This commit is contained in:
parent
4438336d44
commit
ea47574317
@ -328,6 +328,14 @@ class File_X509
|
||||
*/
|
||||
var $recur_limit = 5;
|
||||
|
||||
/**
|
||||
* URL fetch flag
|
||||
*
|
||||
* @var bool
|
||||
* @access private
|
||||
*/
|
||||
var $disable_url_fetch = false;
|
||||
|
||||
/**
|
||||
* Default Constructor.
|
||||
*
|
||||
@ -2161,6 +2169,10 @@ class File_X509
|
||||
*/
|
||||
function _fetchURL($url)
|
||||
{
|
||||
if ($this->disable_url_fetch) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$parts = parse_url($url);
|
||||
$data = '';
|
||||
switch ($parts['scheme']) {
|
||||
@ -2472,6 +2484,26 @@ class File_X509
|
||||
$this->recur_limit = $count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevents URIs from being automatically retrieved
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function disableURLFetch()
|
||||
{
|
||||
$this->disable_url_fetch = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows URIs to be automatically retrieved
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function enableURLFetch()
|
||||
{
|
||||
$this->disable_url_fetch = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reformat public keys
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user