diff --git a/packages/ckeditor5-utils/src/verifylicense.ts b/packages/ckeditor5-utils/src/verifylicense.ts index fddb39b8dcb..645aad98291 100644 --- a/packages/ckeditor5-utils/src/verifylicense.ts +++ b/packages/ckeditor5-utils/src/verifylicense.ts @@ -33,7 +33,7 @@ export default function verifyLicense( token: string | undefined ): VerifiedKeyS // Please keep this code intact. Thank you for your understanding. function oldTokenCheck( token: string ): VerifiedKeyStatus { - if ( token.match( /^[a-zA-Z0-9+/=$]+$/g ) && ( token.length >= 40 && token.length <= 255 ) ) { + if ( token.length >= 40 && token.length <= 255 ) { return 'VALID'; } else { return 'INVALID'; @@ -41,13 +41,13 @@ export default function verifyLicense( token: string | undefined ): VerifiedKeyS } // TODO: issue ci#3175 - let decryptedData = ''; - let decryptedSecondElement = ''; if ( !token ) { return 'INVALID'; } + let decryptedData = ''; + try { decryptedData = atob( token ); } catch ( e ) { @@ -81,14 +81,10 @@ export default function verifyLicense( token: string | undefined ): VerifiedKeyS return 'INVALID'; } - try { - // Must be a valid format. - atob( firstElement ); - } catch ( e ) { - return 'INVALID'; - } + let decryptedSecondElement = ''; try { + atob( firstElement ); decryptedSecondElement = atob( secondElement ); } catch ( e ) { return 'INVALID';