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

How to validate data? #17188

Open
Agnostion opened this issue Sep 30, 2024 · 2 comments
Open

How to validate data? #17188

Agnostion opened this issue Sep 30, 2024 · 2 comments
Labels
pending:feedback This issue is blocked by necessary feedback. type:question This issue asks a question (how to...).

Comments

@Agnostion
Copy link

How can I check on the backend side whether the received content matches the editor settings?

For example, with indents. If I set a step of 40px, then how can I check on the backend side in the right way that the user received exactly 40px in indentation? Is there some way out of the box so that I can create an editor on the back side with specific settings, load content into it and check it for compliance with the settings?

If this is not the case, then I will be glad to receive any advice or examples from your experience, thank you.

Thank you for your editor and the time spent on it, it is very valuable!

@Agnostion Agnostion added the type:question This issue asks a question (how to...). label Sep 30, 2024
@Witoso
Copy link
Member

Witoso commented Oct 3, 2024

How can I check on the backend side whether the received content matches the editor settings? For example, with indents. If I set a step of 40px, then how can I check on the backend side in the right way that the user received exactly 40px in indentation?

Could explain the why? It's cannot grasp the use case here. What do you mean by: the user received exactly 40px in indentation?

@Witoso Witoso added the pending:feedback This issue is blocked by necessary feedback. label Oct 3, 2024
@Agnostion
Copy link
Author

Agnostion commented Oct 4, 2024

How can I check on the backend side whether the received content matches the editor settings? For example, with indents. If I set a step of 40px, then how can I check on the backend side in the right way that the user received exactly 40px in indentation?

Could explain the why? It's cannot grasp the use case here. What do you mean by: the user received exactly 40px in indentation?

So that one user cannot submit any styles, so that the content is within the appropriate frames, and so that other users cannot receive content outside of these frames.
After all, if I configured the editor to indent in increments of 40px, then the user can still manually send a POST request to the server and keep the indentation at, say, 100px

UPD: Sorry if I’m not good at conveying my point, but the editor literally lets you write HTML with styles. And if I want to display this content somewhere, having saved it on the server before, then I need to somehow validate this diverse content before saving it.
And since the editor already has its own validation settings (it clears content if it includes something that is not specified by settings, such as HTML tags, but I don't know what about the CSS in the style attribute), I would like to use them somehow, but on the server side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending:feedback This issue is blocked by necessary feedback. type:question This issue asks a question (how to...).
Projects
None yet
Development

No branches or pull requests

2 participants