mirror of
https://github.com/danog/phpseclib.git
synced 2024-12-05 13:38:50 +01:00
X509: tweaks to mapOutExtensions
This commit is contained in:
parent
c596078d7a
commit
7d3b0a2182
@ -670,7 +670,7 @@ class X509
|
|||||||
*/
|
*/
|
||||||
private function mapOutExtensions(&$root, $path)
|
private function mapOutExtensions(&$root, $path)
|
||||||
{
|
{
|
||||||
$extensions = &$this->subArray($root, $path, true);
|
$extensions = &$this->subArray($root, $path, !empty($this->extensionValues));
|
||||||
|
|
||||||
foreach ($this->extensionValues as $id => $data) {
|
foreach ($this->extensionValues as $id => $data) {
|
||||||
extract($data);
|
extract($data);
|
||||||
@ -679,16 +679,15 @@ class X509
|
|||||||
'extnValue' => $value,
|
'extnValue' => $value,
|
||||||
'critical' => $critical
|
'critical' => $critical
|
||||||
];
|
];
|
||||||
if (!$replace) {
|
if ($replace) {
|
||||||
$extensions[] = $newext;
|
foreach ($extensions as $key => $value) {
|
||||||
continue;
|
if ($value['extnId'] == $id) {
|
||||||
}
|
$extensions[$key] = $newext;
|
||||||
foreach ($extensions as $key => $value) {
|
continue 2;
|
||||||
if ($value['extnId'] == $id) {
|
}
|
||||||
$extensions[$key] = $newext;
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
$extensions[] = $newext;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($extensions)) {
|
if (is_array($extensions)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user