Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validator fails when having functions defined in global scope #2650

Closed
jswiderski opened this issue Dec 5, 2018 · 1 comment
Closed

Validator fails when having functions defined in global scope #2650

jswiderski opened this issue Dec 5, 2018 · 1 comment
Assignees
Labels
status:confirmed An issue confirmed by the development team. support:2 An issue reported by a commercially licensed client. target:minor Any docs related issue that can be merged into a master or major branch. type:bug A bug.
Milestone

Comments

@jswiderski
Copy link
Contributor

Type of report

Bug

Provide detailed reproduction steps (if any)

  1. Open e.g. ckeditor-dev/samples/old/replacebycode.html sample and add below code above replace method.
window.getValue = function(){
	return false;
}

You can also attach external JavaScript file with below code inside

function getValue(){
	return false;
}
  1. Load sample in a browser and open table dialog
  2. Click ok

Expected result

Table gets inserted.

Actual result

Table doesn't get inserted because the validator fails, claiming that row number must greater than 0 even though there is a default value of 3 present in the field.

Other details

  • Browser: Any
  • OS: Any
  • CKEditor version: tested in latest CKEditor 4.11.1
  • Installed CKEditor plugins: table

It seems that regex function in https://github.com/ckeditor/ckeditor-dev/blob/major/plugins/dialog/plugin.js#L3138 references window object.

I have only managed to reproduce this issue with Table dialog but other dialogs could be affected as well.

Sample JS File with global function: testfile.zip

@jswiderski jswiderski added support An issue reported by a commercially licensed client. type:bug A bug. labels Dec 5, 2018
@engineering-this engineering-this added the status:confirmed An issue confirmed by the development team. label Dec 5, 2018
@engineering-this engineering-this self-assigned this Dec 5, 2018
@lslowikowska lslowikowska added support:2 An issue reported by a commercially licensed client. and removed support An issue reported by a commercially licensed client. labels Dec 13, 2018
@Comandeer Comandeer added this to the 4.11.2 milestone Dec 17, 2018
@Comandeer
Copy link
Member

Merged into 4.11.2.

@mlewand mlewand added the target:minor Any docs related issue that can be merged into a master or major branch. label Dec 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:confirmed An issue confirmed by the development team. support:2 An issue reported by a commercially licensed client. target:minor Any docs related issue that can be merged into a master or major branch. type:bug A bug.
Projects
None yet
Development

No branches or pull requests

5 participants