mirror of
https://github.com/danog/phpseclib.git
synced 2024-12-05 21:48:52 +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)
|
||||
{
|
||||
$extensions = &$this->subArray($root, $path, true);
|
||||
$extensions = &$this->subArray($root, $path, !empty($this->extensionValues));
|
||||
|
||||
foreach ($this->extensionValues as $id => $data) {
|
||||
extract($data);
|
||||
@ -679,17 +679,16 @@ class X509
|
||||
'extnValue' => $value,
|
||||
'critical' => $critical
|
||||
];
|
||||
if (!$replace) {
|
||||
$extensions[] = $newext;
|
||||
continue;
|
||||
}
|
||||
if ($replace) {
|
||||
foreach ($extensions as $key => $value) {
|
||||
if ($value['extnId'] == $id) {
|
||||
$extensions[$key] = $newext;
|
||||
break;
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
$extensions[] = $newext;
|
||||
}
|
||||
|
||||
if (is_array($extensions)) {
|
||||
$size = count($extensions);
|
||||
|
Loading…
Reference in New Issue
Block a user