Rev 1432 | Rev 1436 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1432 | Rev 1433 | ||
---|---|---|---|
Line 1025... | Line 1025... | ||
1025 | $count_errors++; |
1025 | $count_errors++; |
1026 | continue; |
1026 | continue; |
1027 | } |
1027 | } |
1028 | 1028 | ||
1029 | $id = "oid:$dot_notation"; |
1029 | $id = "oid:$dot_notation"; |
1030 | $title = isset($xoid->{'description'}) ? $xoid->{'description'}->__toString() : ''; |
1030 | $title = isset($xoid->{'description'}) ? html_entity_decode(strip_tags($xoid->{'description'}->__toString())) : ''; |
1031 | $info = isset($xoid->{'description'}) ? $xoid->{'information'}->__toString() : ''; |
1031 | $info = isset($xoid->{'description'}) ? $xoid->{'information'}->__toString() : ''; |
1032 | 1032 | ||
1033 | // For ASN.1 definitions, "Description" is filled with the definition and "Information" is usually empty |
1033 | // For ASN.1 definitions, "Description" is filled with the definition and "Information" is usually empty |
1034 | if (strpos($title,'<br') !== false) { |
1034 | if (strpos($title,'<br') !== false) { |
1035 | $info = $title . $info; |
1035 | $info = $title . $info; |
Line 1058... | Line 1058... | ||
1058 | $count_errors++; |
1058 | $count_errors++; |
1059 | continue; |
1059 | continue; |
1060 | } |
1060 | } |
1061 | } |
1061 | } |
1062 | 1062 | ||
1063 | if (OIDplus::db()->transaction_supported()) OIDplus::db()->transaction_begin(); |
- | |
1064 | try { |
- | |
1065 | $obj_test = OIDplusObject::findFitting($id); |
1063 | $obj_test = OIDplusObject::findFitting($id); |
1066 | if ($obj_test) { |
1064 | if ($obj_test) { |
1067 | if ($replaceExistingOIDs) { |
1065 | if ($replaceExistingOIDs) { |
1068 | OIDplus::db()->query("delete from ###objects where id = ?", array($id)); |
1066 | OIDplus::db()->query("delete from ###objects where id = ?", array($id)); |
1069 | OIDplus::db()->query("delete from ###asn1id where oid = ?", array($id)); |
1067 | OIDplus::db()->query("delete from ###asn1id where oid = ?", array($id)); |
Line 1077... | Line 1075... | ||
1077 | } |
1075 | } |
1078 | 1076 | ||
1079 | // TODO: we can probably get the created and modified timestamp from oid-info.com XML |
1077 | // TODO: we can probably get the created and modified timestamp from oid-info.com XML |
1080 | OIDplus::db()->query("insert into ###objects (id, parent, title, description, confidential, ra_email) values (?, ?, ?, ?, ?, ?)", array($id, $parent, $title, $info, false, $ra)); |
1078 | OIDplus::db()->query("insert into ###objects (id, parent, title, description, confidential, ra_email) values (?, ?, ?, ?, ?, ?)", array($id, $parent, $title, $info, false, $ra)); |
1081 | 1079 | ||
1082 | if (OIDplus::db()->transaction_supported()) OIDplus::db()->transaction_commit(); |
- | |
1083 | } catch (\Exception $e) { |
- | |
1084 | if (OIDplus::db()->transaction_supported()) OIDplus::db()->transaction_rollback(); |
- | |
1085 | throw new $e; |
- | |
1086 | } |
- | |
1087 | - | ||
1088 | OIDplusObject::resetObjectInformationCache(); |
1080 | OIDplusObject::resetObjectInformationCache(); |
1089 | 1081 | ||
1090 | $this_oid_has_warnings = false; |
1082 | $this_oid_has_warnings = false; |
1091 | 1083 | ||
1092 | // --------------------------------------------------------------------- |
1084 | // --------------------------------------------------------------------- |