X509: add methods to enable / disable URL fetching

This commit is contained in:
terrafrost 2018-03-03 13:42:17 -06:00
parent 4438336d44
commit ea47574317

View File

@ -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
*