X509: fix PHP4 errors

This commit is contained in:
terrafrost 2020-01-17 02:12:27 -06:00
parent 333e2e4c2b
commit ef5e6a909f

View File

@ -2267,7 +2267,7 @@ class File_X509
return false; return false;
} }
$parent = new static(); $parent = new File_X509();
$parent->CAs = $this->CAs; $parent->CAs = $this->CAs;
/* /*
"Conforming applications that support HTTP or FTP for accessing "Conforming applications that support HTTP or FTP for accessing
@ -3000,7 +3000,7 @@ class File_X509
} elseif (is_object($value) && strtolower(get_class($value)) == 'file_asn1_element') { } elseif (is_object($value) && strtolower(get_class($value)) == 'file_asn1_element') {
// @codingStandardsIgnoreStart // @codingStandardsIgnoreStart
$callback = version_compare(PHP_VERSION, '5.3.0') >= 0 ? $callback = version_compare(PHP_VERSION, '5.3.0') >= 0 ?
function ($x) { return "\x" . bin2hex($x[0]); } : eval('return function ($x) { return "\x" . bin2hex($x[0]); };') :
create_function('$x', 'return "\x" . bin2hex($x[0]);'); create_function('$x', 'return "\x" . bin2hex($x[0]);');
// @codingStandardsIgnoreEnd // @codingStandardsIgnoreEnd
$value = strtoupper(preg_replace_callback('#[^\x20-\x7E]#', $callback, $value->element)); $value = strtoupper(preg_replace_callback('#[^\x20-\x7E]#', $callback, $value->element));