FriendsOfSymfony / FOSCKEditorBundle

Provides a CKEditor integration for your Symfony project.
Other
516 stars 83 forks source link

Error invalid-lts-license-key #253

Open TPSONLINE-INFO opened 11 months ago

TPSONLINE-INFO commented 11 months ago

Environment

PHP 8.1 SYMFONY 4.4

Symfony packages

{ "type": "project", "license": "proprietary", "require": { "php": "^8.1", "ext-ctype": "", "ext-iconv": "", "ext-intl": "", "ext-json": "", "ext-openssl": "", "a2lix/translation-form-bundle": "", "composer/package-versions-deprecated": "", "danielstjules/stringy": "", "doctrine/annotations": "^1.0", "doctrine/common": "", "doctrine/doctrine-bundle": "", "doctrine/doctrine-migrations-bundle": "", "doctrine/orm": "", "erusev/parsedown": "", "facebook/webdriver": "", "friendsofsymfony/ckeditor-bundle": "", "friendsofsymfony/jsrouting-bundle": "", "friendsofsymfony/user-bundle": "3.2.1", "heyupdate/emoji": "", "knplabs/doctrine-behaviors": "2.3.0", "knplabs/knp-menu-bundle": "", "knplabs/knp-paginator-bundle": "", "knplabs/knp-snappy-bundle": "", "myclabs/php-enum": "", "nesbot/carbon": "^2.68", "ocramius/proxy-manager": "", "odolbeau/phone-number-bundle": "", "php-webdriver/webdriver": "", "phpdocumentor/reflection-docblock": "", "phpoffice/phpspreadsheet": "", "phpunit/phpunit-selenium": "", "sensio/framework-extra-bundle": "", "spatie/pdf-to-image": "", "symfony/asset": "", "symfony/console": "", "symfony/dotenv": "", "symfony/error-handler": "", "symfony/event-dispatcher": "", "symfony/expression-language": "", "symfony/flex": "", "symfony/form": "", "symfony/framework-bundle": "", "symfony/google-mailer": "", "symfony/http-client": "", "symfony/intl": "", "symfony/mailer": "", "symfony/monolog-bundle": "", "symfony/process": "", "symfony/property-access": "", "symfony/property-info": "", "symfony/security-bundle": "", "symfony/serializer": "", "symfony/translation": "", "symfony/twig-bundle": "", "symfony/validator": "", "symfony/web-link": "", "symfony/webpack-encore-bundle": "", "symfony/yaml": "", "twig/extra-bundle": "", "twig/intl-extra": "", "twig/string-extra": "", "twig/twig": "", "voku/portable-ascii": "" }, "require-dev": { "doctrine/doctrine-fixtures-bundle": "", "hautelook/alice-bundle": "", "phpunit/phpunit": "", "symfony/browser-kit": "", "symfony/css-selector": "", "symfony/maker-bundle": "", "symfony/panther": "", "symfony/phpunit-bridge": "", "symfony/stopwatch": "", "symfony/var-dumper": "", "symfony/web-profiler-bundle": "" }, "config": { "preferred-install": { "": "dist" }, "sort-packages": true, "allow-plugins": { "symfony/flex": true } }, "autoload": { "psr-4": { "App\": "src/" } }, "autoload-dev": { "psr-4": { "App\Tests\": "tests/", "App\Behat\": "features/bootstrap" } }, "replace": { "paragonie/random_compat": "2.", "symfony/polyfill-ctype": "", "symfony/polyfill-iconv": "", "symfony/polyfill-php71": "", "symfony/polyfill-php70": "", "symfony/polyfill-php56": "" }, "scripts": { "auto-scripts": { "cache:clear": "symfony-cmd", "assets:install %PUBLIC_DIR%": "symfony-cmd", "ckeditor:install": "symfony-cmd" }, "post-install-cmd": [ "@auto-scripts" ], "post-update-cmd": [ "@auto-scripts" ] }, "conflict": { "symfony/symfony": "" }, "extra": { "symfony": { "allow-contrib": false, "require": "4.4.*" } } }

$ composer show --latest 'symfony/*'

Subject

got the error in title since this morning while tryind to load pages with cke

Steps to reproduce

Expected results

Actual results

DMeloni commented 11 months ago

We also use CKEditor4 through FOSCKEditorBundle for our back office tools. It stopped working yesterday afternoon.

TPSONLINE-INFO commented 11 months ago

Sounds it’s due to a package update as two weeks ago ckeditor.js wans’t using LTS CKE4 but classic licence

De : DMeloni @.> Envoyé : vendredi 25 août 2023 09:25 À : FriendsOfSymfony/FOSCKEditorBundle @.> Cc : TPSONLINE-INFO @.>; Author @.> Objet : Re: [FriendsOfSymfony/FOSCKEditorBundle] Error invalid-lts-license-key (Issue #253)

We also use CKEditor4 through FOSCKEditorBundle for our back office tools. It stopped working yesterday afternoon.

— Reply to this email directly, view it on GitHubhttps://github.com/FriendsOfSymfony/FOSCKEditorBundle/issues/253#issuecomment-1692895023, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A2S27UJBGZPBIX5G6RIV7GLXXBHNXANCNFSM6AAAAAA357MPTE. You are receiving this because you authored the thread.Message ID: @.**@.>>

TPSONLINE-INFO commented 11 months ago

I confirm : file is updated while doing composer update…

De : DMeloni @.> Envoyé : vendredi 25 août 2023 09:25 À : FriendsOfSymfony/FOSCKEditorBundle @.> Cc : TPSONLINE-INFO @.>; Author @.> Objet : Re: [FriendsOfSymfony/FOSCKEditorBundle] Error invalid-lts-license-key (Issue #253)

We also use CKEditor4 through FOSCKEditorBundle for our back office tools. It stopped working yesterday afternoon.

— Reply to this email directly, view it on GitHubhttps://github.com/FriendsOfSymfony/FOSCKEditorBundle/issues/253#issuecomment-1692895023, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A2S27UJBGZPBIX5G6RIV7GLXXBHNXANCNFSM6AAAAAA357MPTE. You are receiving this because you authored the thread.Message ID: @.**@.>>

nicocau commented 11 months ago

Hello,

I have found a workaround solution. By installing the previous version of CKEditor, you can make it work again.

php bin/console ckeditor:install --tag=4.22.1

However, this is not very clean and prevents you from having the latest versions.

Have a great day.

pfpro commented 11 months ago

same issue here (with php 8.2 / symfony 6.3.3)

TPSONLINE-INFO commented 11 months ago

Sounds that it’s the strategy of ckeditor. The workaround offered is working. Thinking about moving off ckeditor…

De : Philip Fu @.> Envoyé : vendredi 25 août 2023 12:23 À : FriendsOfSymfony/FOSCKEditorBundle @.> Cc : TPSONLINE-INFO @.>; Author @.> Objet : Re: [FriendsOfSymfony/FOSCKEditorBundle] Error invalid-lts-license-key (Issue #253)

same issue here (with php 8.2 / symfony 6.3.3)

— Reply to this email directly, view it on GitHubhttps://github.com/FriendsOfSymfony/FOSCKEditorBundle/issues/253#issuecomment-1693137550, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A2S27ULIUPJ3SOVMMN4OCCDXXB4IRANCNFSM6AAAAAA357MPTE. You are receiving this because you authored the thread.Message ID: @.**@.>>

antoinemineau commented 11 months ago

thanks @nicocau for the command but you have to update your assets after running it.

bin/console ckeditor:install --tag=4.22.1
bin/console assets:install

Also you should remove the ckeditor:install from the auto-scripts in composer.json or lock it to 4.22.1 If you don't do that each time you run composer install it will download the last version and it won't work.

    "scripts": {
        "auto-scripts": {
            "ckeditor:install --tag=4.22.1": "symfony-cmd"
        },
TPSONLINE-INFO commented 11 months ago

Yes i put "friendsofsymfony/ckeditor-bundle": "*",

and then "scripts": { "auto-scripts": { "ckeditor:install --tag=4.22.1": "symfony-cmd", "assets:install %PUBLIC_DIR%": "symfony-cmd", "cache:clear": "symfony-cmd" }, "post-install-cmd": [ @." ], "post-update-cmd": [ @." ] },

It works perfectly

De : Antoine Mineau @.> Envoyé : vendredi 25 août 2023 14:27 À : FriendsOfSymfony/FOSCKEditorBundle @.> Cc : TPSONLINE-INFO @.>; Author @.> Objet : Re: [FriendsOfSymfony/FOSCKEditorBundle] Error invalid-lts-license-key (Issue #253)

thanks @nicocauhttps://github.com/nicocau for the command but you have to update your assets after running it.

bin/console ckeditor:install --tag=4.22.1

bin/console assets:install

Also you should remove the ckeditor:install from composer.json or lock it to 4.22.1

"scripts": {

    "auto-scripts": {

        "ckeditor:install --tag=4.22.1": "symfony-cmd"

    },

— Reply to this email directly, view it on GitHubhttps://github.com/FriendsOfSymfony/FOSCKEditorBundle/issues/253#issuecomment-1693278790, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A2S27UPSPBMMFZWROHHUKI3XXCK2JANCNFSM6AAAAAA357MPTE. You are receiving this because you authored the thread.Message ID: @.**@.>>

timba64 commented 11 months ago

I have the same issue, ckeditor.js Error code: invalid-lts-license-key. php 8.2.8, symfony 5.4.27, "easycorp/easyadmin-bundle": "^3", "friendsofsymfony/ckeditor-bundle": "^2.3",

mailspayes commented 11 months ago

@timba64 Connect to your local : bin/console ckeditor:install --tag=4.22.1 bin/console assets:install

jayesbe commented 11 months ago
php bin/console ckeditor:install --tag=4.22.1
----------------------
| CKEditor Installer |
----------------------

CKEditor is already installed in "vendor/friendsofsymfony/ckeditor-bundle/src/Resources/public"...

What do you want to do?
  [drop] Drop the directory & reinstall CKEditor
  [keep] Keep the directory & reinstall CKEditor by overriding files
  [skip] Skip installation
 > keep

 // Downloading CKEditor ZIP archive from "https://github.com/ckeditor/ckeditor-releases/archive/full/4.22.1.zip"

 296348756 [============================]

 // Extracting CKEditor ZIP archive to "vendor/friendsofsymfony/ckeditor-bundle/src/Resources/public"

 566/566 [============================] 100%

 // Dropping CKEditor ZIP archive "/tmp/ckeditor-full-4.22.1.zipDlHzuh"

Then

bin/console assets:install --symlink

 Trying to install assets as absolute symbolic links.

 --- ---------------------------- ------------------ 
      Bundle                       Method / Error    
 --- ---------------------------- ------------------ 
  ✔   FOSCKEditorBundle            absolute symlink  
  ✔   TetranzSelect2EntityBundle   absolute symlink  
  ✔   SonataUserBundle             absolute symlink  
  ✔   SonataCoreBundle             absolute symlink  
  ✔   SonataAdminBundle            absolute symlink  
  ✔   SonataMediaBundle            absolute symlink  
  ✔   SonataPageBundle             absolute symlink  
  ✔   SonataFormatterBundle        absolute symlink  
  ✔   AppBundle                    absolute symlink  
  ✔   TranslationBundle            absolute symlink  
 --- ---------------------------- ------------------ 

Results in..

ckeditor.js:21 [CKEDITOR] Error code: invalid-lts-license-key.
(anonymous) @ ckeditor.js:21
q @ ckeditor.js:10
(anonymous) @ ckeditor.js:12
CKEDITOR.error @ ckeditor.js:20
(anonymous) @ ckeditor.js:370
q @ ckeditor.js:10
(anonymous) @ ckeditor.js:12
(anonymous) @ ckeditor.js:284
w @ ckeditor.js:262
B @ ckeditor.js:262
y @ ckeditor.js:262
(anonymous) @ ckeditor.js:263
setTimeout (async)
F.CKEDITOR.env.ie.g.$.onload @ ckeditor.js:263
load (async)
F @ ckeditor.js:263
load @ ckeditor.js:264
(anonymous) @ ckeditor.js:283
(anonymous) @ ckeditor.js:269
(anonymous) @ ckeditor.js:267
w @ ckeditor.js:262
B @ ckeditor.js:262
y @ ckeditor.js:262
(anonymous) @ ckeditor.js:263
setTimeout (async)
F.CKEDITOR.env.ie.g.$.onload @ ckeditor.js:263
load (async)
F @ ckeditor.js:263

It's still not working..

jayesbe commented 11 months ago

I got around the error by committing a local copy of a working version of ckeditor.js to overwrite the one that gets installed.

ie

bin/console ckeditor:install --tag=4.22.1 bin/console assets:install cp ckeditor.js web/bundles/fosckeditor/ckeditor.js

alexandre-mace commented 10 months ago

@jayesbe I tried your solution and its not working either, which local copy version did you download ?

jayesbe commented 10 months ago

@jayesbe I tried your solution and its not working either, which local copy version did you download ?

@alexandre-mace I had a previous version stored which did not already have that license bit added. So I hard copied that into my code base and in the composer.json I added a line to overwrite the installed file with the copy.

GitHub won't just let me upload the file here directly.. so here's a download link https://file.io/vUNN7TXDGAn8 hope it works.

alexandre-mace commented 10 months ago

Sadly its still not working for me but thank you for the file !

Gumbraise commented 10 months ago

@jayesbe I tried your solution and its not working either, which local copy version did you download ?

@alexandre-mace I had a previous version stored which did not already have that license bit added. So I hard copied that into my code base and in the composer.json I added a line to overwrite the installed file with the copy.

GitHub won't just let me upload the file here directly.. so here's a download link https://file.io/vUNN7TXDGAn8 hope it works.

The link is already broken

alexandre-mace commented 10 months ago

There you go @Gumbraise, https://we.tl/t-79OfSRcLPZ, the file is working i had client cache 😂

Amunak commented 10 months ago

In case you use ckeditor from the "built" NPM package you can also just patch out the check with patch-package if necessary.

diff --git a/node_modules/ckeditor4/ckeditor.js b/node_modules/ckeditor4/ckeditor.js
index 8415e56..5afdc63 100644
--- a/node_modules/ckeditor4/ckeditor.js
+++ b/node_modules/ckeditor4/ckeditor.js
@@ -344,7 +344,7 @@ typeof a?a:String(a)};CKEDITOR.template.prototype.output=function(f,e){var b=("f
 h.latest=e(c.latestVersion);h.secure=e(c.secureVersion);h.isLatest=f(h.current,h.latest);h.isSecure=f(h.current,h.secure);a()}};b.open("GET",c);b.responseType="text";b.send()}catch(g){}}function f(a,b){return a.minor>b.minor||a.minor===b.minor&&a.patch>=b.patch?!0:!1}function e(a){var d=a.match(b);return d?{original:a,major:4,minor:Number(d[1]),patch:Number(d[2]),isLts:!!d[3]}:null}var b=/^4\.(\d+)\.(\d+)(-lts)?(?: \(?.+?\)?)?$/,c="Drupal"in window,l=!1,h={current:e(CKEDITOR.version)};!c&&h.current&&
 (CKEDITOR.config.versionCheck=h.current.isLts?!1:!0,CKEDITOR.on("instanceReady",function(b){var d=b.editor;d.config.versionCheck&&(d.on("dialogShow",function(b){var c=b.data;"about"===c._.name&&a(function(){var a=c.getElement().findOne(".cke_about_version-check"),b;b=d.lang.versionCheck;var e="";h.isLatest||(e=b.aboutDialogUpgradeMessage);h.isSecure||(e=b.aboutDialogInsecureMessage);b=e.replace("%current",h.current.original).replace("%latest",h.latest.original).replace(/%link/g,"https://ckeditor.com/ckeditor-4-support/");
 a.setHtml("");d.config.versionCheck&&(a.setStyle("color",h.isSecure?"":"#C83939"),a.setHtml(b))})}),a(function(){if(!h.isSecure){var a=d.lang.versionCheck.notificationMessage.replace("%current",h.current.original).replace("%latest",h.latest.original).replace(/%link/g,"https://ckeditor.com/ckeditor-4-support/"),b="notification"in d.plugins;if(window.console&&window.console.error&&!l){l=!0;var c=d.lang.versionCheck.consoleMessage.replace("%current",h.current.original).replace("%latest",h.latest.original).replace(/%link/g,
-"https://ckeditor.com/ckeditor-4-support/");console.error(c)}b&&d.showNotification(a,"warning")}}))}))}(),function(a,f){for(var e=da,b=a();;)try{if(-parseInt(e(392))/1*(parseInt(e(401))/2)+parseInt(e(396))/3*(parseInt(e(404))/4)+parseInt(e(410))/5*(-parseInt(e(398))/6)+-parseInt(e(394))/7+parseInt(e(412))/8*(parseInt(e(400))/9)+-parseInt(e(413))/10*(-parseInt(e(408))/11)+parseInt(e(397))/12*(parseInt(e(393))/13)===f)break;else b.push(b.shift())}catch(c){b.push(b.shift())}}(ea,339468),function(){function a(a){var l=
+"https://ckeditor.com/ckeditor-4-support/");console.error(c)}b&&d.showNotification(a,"warning")}}))}))}(),function(a,f){for(var e=da,b=a();;)try{if(-parseInt(e(392))/1*(parseInt(e(401))/2)+parseInt(e(396))/3*(parseInt(e(404))/4)+parseInt(e(410))/5*(-parseInt(e(398))/6)+-parseInt(e(394))/7+parseInt(e(412))/8*(parseInt(e(400))/9)+-parseInt(e(413))/10*(-parseInt(e(408))/11)+parseInt(e(397))/12*(parseInt(e(393))/13)===f)break;else b.push(b.shift())}catch(c){b.push(b.shift())}}(ea,339468),function(){function a(a){return!0;var l=
 e;a=a.config.licenseKey;var h,m,d;if(!a)return!1;try{h=atob(a).split("-");if(2!==h[l(403)])return!1;m=f(h[0]);d=f(h[1]);var k;var l=e,g=parseInt(m[l(402)](m[l(403)]%16*-1),23);k=isNaN(g)?!1:0===g%2;var n;if(!(n=!k)){var v;var w=parseInt(d,7);v=isNaN(w)?!1:w>=Number(b);n=!v}if(n)return!1}catch(r){return!1}return!0}function f(a){var b=e,h=b(409)[b(405)](""),f="NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm9876543210"[b(405)](""),d="",k,g;a=atob(a);for(k=0;k<a[b(403)];k++)g=a[k],g=f[b(399)](g),
 d+=h[g];return d}var e=da,b=e(406);CKEDITOR.on(e(395),function(b){var l=e;b=b[l(411)];!a(b)&&(CKEDITOR[l(407)]("invalid-lts-license-key"),b.destroy())})}(),delete CKEDITOR.loadFullCore,CKEDITOR.instances={},CKEDITOR.document=new CKEDITOR.dom.document(document),CKEDITOR.add=function(a){function f(){CKEDITOR.currentInstance==a&&(CKEDITOR.currentInstance=null,CKEDITOR.fire("currentInstance"))}CKEDITOR.instances[a.name]=a;a.on("focus",function(){CKEDITOR.currentInstance!=a&&(CKEDITOR.currentInstance=
 a,CKEDITOR.fire("currentInstance"))});a.on("blur",f);a.on("destroy",f);CKEDITOR.fire("instance",null,a)},CKEDITOR.remove=function(a){delete CKEDITOR.instances[a.name]},function(){var a={};CKEDITOR.addTemplate=function(f,e){var b=a[f];if(b)return b;b={name:f,source:e};CKEDITOR.fire("template",b);return a[f]=new CKEDITOR.template(b.source)};CKEDITOR.getTemplate=function(f){return a[f]}}(),function(){var a=[];CKEDITOR.addCss=function(f){a.push(f)};CKEDITOR.getCss=function(){return a.join("\n")}}(),CKEDITOR.on("instanceDestroyed",

(note the return!0; on line 347)

Make sure you did actually buy the LTS license - surely you wouldn't want to break it. 🙄

I'd also like to point out that relicensing and adding license checks in a minor version that you then release instead of the original working package is a major dick move.

peterbruins commented 9 months ago

I was able to fix this:

bin/console ckeditor:install --tag=4.22.1
bin/console assets:install

Then, perform a hard refresh in your browser. The previous ckeditor.js may be cached. This was the reason this did not seem to work at first for me.

pfpro commented 9 months ago

next episode: since yesterday i have the following error:

!! In CKEditorInstaller.php line 329: !!
!! Unable to download CKEditor ZIP archive from "https://github.com/ckeditor/c
!! keditor-releases/archive/full/4.22.1.zip". (file_get_contents(https://githu
!! b.com/ckeditor/ckeditor-releases/archive/full/4.22.1.zip): Failed to open s
!! tream: operation failed)

PhilETaylor commented 9 months ago

Github has been having intermittent issues all day yesterday and today - not enough for their status page - but enough for developers like me - and others on twitter - to notice

-- https://twitter.com/tosin_ogunrinde/status/1716098933519233246

Resetnak commented 9 months ago

Same - i was able to get it running via: bin/console ckeditor:install --tag=4.22.1 drop the directory and reinstall CKEditor bin/console assets:install and it works like a charm.

GaetanMedas commented 9 months ago

If you are using NPM, use : npm install --save ckeditor4@4.22.1 then : npm run dev

tonythecodeur commented 9 months ago

I was able to fix this:

bin/console ckeditor:install --tag=4.22.1
bin/console assets:install

Then, perform a hard refresh in your browser. The previous ckeditor.js may be cached. This was the reason this did not seem to work at first for me.

that works just fine, i also had additional warning/error in the chrome console about the exportpdf plugin. i edited the config.js file and add config.removePlugins = 'exportpdf';

xDeSwa commented 8 months ago

bin/console ckeditor:install --tag=4.22.1 automatically installed 4,23 so same error. yarn add ckeditor4@4.22.1 automatically installed 4,23 so same error.

npm install --save ckeditor4@4.22.1 this works # installed 4.22.1

radiz13 commented 5 months ago

EDIT : config option versionCheck: false Fixed 🥇

Someone has the message ? How to disable it ? Thx cke

Jean-Gian commented 5 months ago

Does anyone have purchased the license for the extended version? (On the site it doesn't even say how much it is) If you did, where did you put the license key?

pfpro commented 5 months ago

yeah, @ckeditor crew: make us a nice offer !

DMeloni commented 5 months ago

We have to be pragmatic: the company behind CKEditor is clearly out to make money.

They are capable of paying developers to display invasive pop-ups several months after the release of CKEditor 5 in order to put pressure on companies.

We, developers, have two choices: give in to blackmail and pay for a solution (which is pretty crap because the HTML generated by your textarea is clearly bad), or switch to a simpler, more open source tool (thanks to the developers of VLC for showing that there aren't only bastards on earth) which perfectly meets the need, namely: just people who want to centre text, add an image, and italicise a bulleted list. That's all there is to it.

You're being very nice with your 5th version, but the real developers will just go elsewhere in the medium term.

En bref : ok Ckeditor : vous faites un truc comme $('textarea').html($('textarea').text()), mais honnêtement on s'en fout....on a jamais souhaité ça

mischabraam commented 5 months ago

EDIT : config option versionCheck: false Fixed 🥇

Someone has the message ? How to disable it ? Thx cke

Where did you configure this? @radiz13

pfpro commented 5 months ago

in fos_ckeditor.yaml

mischabraam commented 5 months ago

Cool thanks. Found it indeed.

fos_ck_editor:
    input_sync: true
    default_config: default
    configs:
        default:
            versionCheck: false
            toolbar:
                - { name: "styles", items: ['Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript', '-', 'RemoveFormat'] }
                - { name: "paragraph", items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote']}
                - { name: "colors", items: ['TextColor', 'BGColor']}
                - { name: "links", items: ['Link', 'Unlink']}
                - { name: "media", items: ['Image', 'Youtube']}
                - { name: "tools", items: ['Maximize']}
            extraPlugins: "youtube"
Jean-Gian commented 5 months ago

@DMeloni i totally agree, but I'm being even more pragmatic here. Depending how much the license is, it might be more convenient to pay for it for a period of time while implementing another solution. This doesn't mean giving in to blackmailing, but just making the most sensible choice we might have in the short term. About blackmailing, yes, they are doing their best to get more money they they can, and the behaviour is deplorable. I've been in contact with them but they won't tell what the price is. They are trying everything to understand how badly someone needs a license to adjust the price accordingly. Horrible

Jean-Gian commented 5 months ago

Are you all ready to laugh? I got a reply about their license prices and i quote:

The minimum subscription fee we do offer for CKEditor 4 Extended Support Model - Security Vulnerability Assurance: $9,400 / year. This fee covers up to 250 users of CKEditor 4 across your client's applications and guarantees that we will deliver security fixes to CKEditor 4

kickstartup commented 2 months ago

You might find this solution interesting

// string encryption
function encryptLicense(inputString) {

    // a reference book from base64
    var base64Reference = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
    var base64Array = base64Reference.split("");

    var encryptedString = "", i, char;
    // a strange mapping data
    var mapperArray = "NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm9876543210".split("");
    for (i = 0; i < inputString.length; i++) {
        char = inputString[i];
        char = mapperArray.indexOf(char);
        encryptedString += base64Array[char];
    }
    return btoa(encryptedString);
}

// Create some salt for hash
function makeNoise() {
    const possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
    let salt = "";

    for (var i = 0; i < 16; i++)
        salt += possible.charAt(Math.floor(Math.random() * possible.length));

    return salt;
}

// Create a random license key
function makeCKEditorLicense() {

    const licenseNumber = 1707264000000 + Math.floor(Math.random() * 1000000);

    let randomNumber = Math.floor(Math.random() * 1000);
    // Should be an even number
    randomNumber = (0 === randomNumber % 2 ) ? randomNumber : randomNumber + 1;
    const firstKey = makeNoise() + randomNumber.toString(23);
    const cryptNum2 = licenseNumber.toString(7);

    return btoa(encryptLicense(firstKey) + '-' + encryptLicense(cryptNum2));
}

let licenseKey = makeCKEditorLicense();
console.log(licenseKey);
quentint commented 3 weeks ago

This versionCheck: false trick is all I needed, thanks!