AttrWhiteList Property

Rich Text Editor for PHP

RichTextEditor for PHP 8.0 Class Library

Editor.AttrWhiteList Property

The editor HTML Filter allows you to accept HTML input from your users, filter it to make sure it contains only an allowed set of tags, attributes and values and then display it without leaving yourself open to XSS holes. AttrWhiteList property allows you set a list of html attributes that will not be removed from content sources.

Example

<?php   
    $rte=new RichTextEditor();   
    $rte->Text="Type here"; 
    $rte->AttrWhiteList="title,style";   
    $rte->ID="Editor1";    
    $rte->MvcInit(); 
    echo $rte->GetString();  
    // use $_POST["Editor1"]to retrieve the data  
?> 

See Also

Editor Class | RTE Namespace