Donzoby
Donzoby

Reputation: 151

Adding inline CSS style to tinymce editor content makes Laravel endpoint to return 403 error

I am building a content management system for tutorials site. To make the creating of content easier I am using Tinymce editor.

I can add and edit post without problem as long as I don't apply any style to editor content which includes inline CSS in editor content.

For example, if I have the following content in my Tinymce editor, there will be no problem:

<ul>
<li>img</li>
<li>span</li>
<li>input</li>
<li>a</li>
<li>textarea</li>
<li>etc</li>
</ul>

The above will submit to my Laravel resource endpoint without issues.

But the moment there is inline style in the editor content as shown below, the request will not even reach my controller. It will just return the post data with a 403 (Forbidden) error.

<ul style="list-style-type: square;">
<li>img</li>
<li>span</li>
<li>input</li>
<li>a</li>
<li>textarea</li>
<li>etc</li>
</ul>

The above editor content with inline CSS fails without even reaching the post store/update controller.

Furthermore, I don't have this problem when developing locally. I only experience when I deploy to Cpanel(shared hosting).

I have been on this for days. I tried using fetch instead of axios, tried submitting the form directly without using JavaScript and none of this changed anything. But as soon as I remove the inline style, it submit without any problem.

Upvotes: 0

Views: 32

Answers (0)

Related Questions