Test sample Test sample - 3 days ago 6
PHP Question

Tinymce font-color not support after saving in codeigniter

I'm using tinymce text editor in codeigniter fusion invoice. after saving text the editor will show the content like below in textarea source code.

<!DOCTYPE html>
<html>
<head>
</head>
<body>
<p><span ff00ff="" ff99cc="">dffghfgh</span></p>
</body>
</html>


My tinymce code is

tinymce.init({
selector: "textarea",
verify_html: false,
plugins: [
"fullpage",
"advlist autolink lists link image charmap print preview anchor",
"searchreplace visualblocks code fullscreen",
"insertdatetime media table contextmenu paste",
"textcolor"
],
toolbar: "insertfile undo redo | fontselect fontsizeselect styleselect | bold italic | forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
textcolor_map: [
"000000", "Black",.. ]
});

Answer

The reason is XSS filtering.

Please use this:

$this->input->post('your_input_name', false)

instead of this:

$this->input->post('your_input_name')

Comments