Log in
Model

Validator

Magento\Cms\Model\Wysiwyg\Validator

What it does

This class validates WYSIWYG HTML content in Magento 2's CMS module, ensuring it doesn't contain restricted or malicious elements.

Developers use it when saving CMS pages, blocks, or other content with WYSIWYG editors to enforce HTML security standards.

Based on configuration, it either throws exceptions for invalid HTML or displays warning messages while allowing the save.

Public Methods

  • validate()