Rev 27 | Rev 29 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 27 | Rev 28 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | <?php |
1 | <?php |
2 | 2 | ||
3 | /* |
3 | /* |
4 | * OID-Info.com API for PHP |
4 | * OID-Info.com API for PHP |
5 | * Copyright 2019-2021 Daniel Marschall, ViaThinkSoft |
5 | * Copyright 2019-2022 Daniel Marschall, ViaThinkSoft |
6 | * Version 2021-12-08 |
6 | * Version 2022-01-10 |
7 | * |
7 | * |
8 | * Licensed under the Apache License, Version 2.0 (the "License"); |
8 | * Licensed under the Apache License, Version 2.0 (the "License"); |
9 | * you may not use this file except in compliance with the License. |
9 | * you may not use this file except in compliance with the License. |
10 | * You may obtain a copy of the License at |
10 | * You may obtain a copy of the License at |
11 | * |
11 | * |
Line 650... | Line 650... | ||
650 | if (isset($elements['current-registrant']['email'])) |
650 | if (isset($elements['current-registrant']['email'])) |
651 | $elements['current-registrant']['email'] = $this->softCorrectEMail($elements['current-registrant']['email'], $params); |
651 | $elements['current-registrant']['email'] = $this->softCorrectEMail($elements['current-registrant']['email'], $params); |
652 | 652 | ||
653 | // TODO: if name is empty, but address has 1 line, take it as firstname (but remove hyperlink) |
653 | // TODO: if name is empty, but address has 1 line, take it as firstname (but remove hyperlink) |
654 | 654 | ||
- | 655 | $ignore_current_registrant = false; |
|
- | 656 | $test_keys = array_keys($elements['current-registrant']); |
|
- | 657 | if ((count($test_keys) == 1) && ($test_keys[0] == 'modification-date')) { |
|
- | 658 | // Modification dates without information about the current RA which are rejected by the OID repository |
|
- | 659 | $ignore_current_registrant = true; |
|
- | 660 | } |
|
- | 661 | ||
655 | $out_loc = ''; |
662 | $out_loc = ''; |
656 | foreach ($elements as $name => $val) { |
663 | foreach ($elements as $name => $val) { |
657 | if (($name == 'first-registrant') || ($name == 'current-registrant')) { |
664 | if (($name == 'first-registrant') || ($name == 'current-registrant')) { |
- | 665 | if (($name != 'current-registrant') || !$ignore_current_registrant) { |
|
658 | $out_loc2 = ''; |
666 | $out_loc2 = ''; |
659 | foreach ($val as $name2 => $val2) { |
667 | foreach ($val as $name2 => $val2) { |
660 | if (is_null($val2)) continue; |
668 | if (is_null($val2)) continue; |
661 | if (empty($val2)) continue; |
669 | if (empty($val2)) continue; |
662 | 670 | ||
Line 680... | Line 688... | ||
680 | if (!empty($out_loc2)) { |
688 | if (!empty($out_loc2)) { |
681 | $out_loc .= "\t\t<$name>\n"; |
689 | $out_loc .= "\t\t<$name>\n"; |
682 | $out_loc .= $out_loc2; |
690 | $out_loc .= $out_loc2; |
683 | $out_loc .= "\t\t</$name>\n"; |
691 | $out_loc .= "\t\t</$name>\n"; |
684 | } |
692 | } |
- | 693 | } |
|
685 | } else { |
694 | } else { |
686 | // if (is_null($val)) continue; |
695 | // if (is_null($val)) continue; |
687 | if (empty($val) && ($name != 'description')) continue; // description is mandatory, according to http://oid-info.com/oid.xsd |
696 | if (empty($val) && ($name != 'description')) continue; // description is mandatory, according to http://oid-info.com/oid.xsd |
688 | 697 | ||
689 | if (!is_array($val)) $val = array($val); |
698 | if (!is_array($val)) $val = array($val); |