Rev 1317 | Rev 1336 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1317 | Rev 1333 | ||
---|---|---|---|
Line 833... | Line 833... | ||
833 | * @throws OIDplusException |
833 | * @throws OIDplusException |
834 | */ |
834 | */ |
835 | private static function registerObjectTypePlugin(OIDplusObjectTypePlugin $plugin) { |
835 | private static function registerObjectTypePlugin(OIDplusObjectTypePlugin $plugin) { |
836 | self::$objectTypePlugins[] = $plugin; |
836 | self::$objectTypePlugins[] = $plugin; |
837 | 837 | ||
- | 838 | if (OIDplus::baseConfig()->getValue('DEBUG')) { |
|
- | 839 | // Avoid a namespace hash conflict of the OIDplus Information Object Custom UUIDs |
|
- | 840 | // see here https://github.com/danielmarschall/oidplus/blob/master/doc/oidplus_custom_guid.md |
|
- | 841 | if (!str_starts_with($plugin->getManifest()->getOid(), '1.3.6.1.4.1.37476.2.5.2.4.8.')) { |
|
- | 842 | $coll = []; |
|
- | 843 | for ($i = 1; $i <= 185; $i++) { |
|
- | 844 | $block4 = dechex(hexdec(substr(sha1('1.3.6.1.4.1.37476.2.5.2.4.8.'.$i), -4)) & 0x3FFF | 0x8000); |
|
- | 845 | $coll[] = $block4; |
|
- | 846 | } |
|
- | 847 | $block4 = dechex(hexdec(substr(sha1($plugin->getManifest()->getOid()), -4)) & 0x3FFF | 0x8000); |
|
- | 848 | if (in_array($block4, $coll)) { |
|
- | 849 | throw new OIDplusException(_L("A third-party vendor object type plugin with OID %1 has a hash-conflict with a ViaThinkSoft plugin. Please recommend to the developer to pick a different OID for their plugin. More information here: %2",$plugin->getManifest()->getOid(),'https://github.com/danielmarschall/oidplus/blob/master/doc/oidplus_custom_guid.md')); |
|
- | 850 | } |
|
- | 851 | } |
|
- | 852 | } |
|
- | 853 | ||
838 | $ot = $plugin::getObjectTypeClassName(); |
854 | $ot = $plugin::getObjectTypeClassName(); |
839 | self::registerObjectType($ot); |
855 | self::registerObjectType($ot); |
840 | } |
856 | } |
841 | 857 | ||
842 | /** |
858 | /** |