mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-25 11:20:03 +00:00
RSA: PHP 8.4 deprecated xml_set_object()
This commit is contained in:
parent
181f13a9d8
commit
58709cff79
@ -1478,9 +1478,14 @@ class Crypt_RSA
|
|||||||
$this->components = array();
|
$this->components = array();
|
||||||
|
|
||||||
$xml = xml_parser_create('UTF-8');
|
$xml = xml_parser_create('UTF-8');
|
||||||
xml_set_object($xml, $this);
|
if (version_compare(PHP_VERSION, '8.4.0', '>=')) {
|
||||||
xml_set_element_handler($xml, '_start_element_handler', '_stop_element_handler');
|
xml_set_element_handler($xml, array($this, '_start_element_handler'), array($this, '_stop_element_handler'));
|
||||||
xml_set_character_data_handler($xml, '_data_handler');
|
xml_set_character_data_handler($xml, array($this, '_data_handler'));
|
||||||
|
} else {
|
||||||
|
xml_set_object($xml, $this);
|
||||||
|
xml_set_element_handler($xml, '_start_element_handler', '_stop_element_handler');
|
||||||
|
xml_set_character_data_handler($xml, '_data_handler');
|
||||||
|
}
|
||||||
// add <xml></xml> to account for "dangling" tags like <BitStrength>...</BitStrength> that are sometimes added
|
// add <xml></xml> to account for "dangling" tags like <BitStrength>...</BitStrength> that are sometimes added
|
||||||
if (!xml_parse($xml, '<xml>' . $key . '</xml>')) {
|
if (!xml_parse($xml, '<xml>' . $key . '</xml>')) {
|
||||||
xml_parser_free($xml);
|
xml_parser_free($xml);
|
||||||
|
Loading…
Reference in New Issue
Block a user