1

I have a RichText field using a standard config. "Clean up HTML" and "Purify HTML" are OFF.

I have a page with a paragraph of text, then an unordered list. After that list, I try to insert another paragraph and add a line with a mailto link in it.

No matter what, the link gets removed/stripped out. If I move the paragraph up before the UL, it works. But being after the UL list, it's getting stripped out.

Essentially the text in the editor looks like:

<p>text</p>
<ul>
  <li><strong>title</strong> line of text</li>
  <li><strong>title</strong> line of text</li>
</ul>
<p><a href="mailto:myaddress@email.com">Send us a message</a></p>

I did try checking both purify and clean HTML options ON, but that didn't work either. I've tried inserting the text via html view as well as visual view. Still can't get it to stick. I've tried adding multiple paragraphs after the UL list, but HTML is getting stripped out of everything after the list.

Anyone have any ideas?

My standard config json is:

{ buttons: ['html','formatting','bold','italic','unorderedlist','orderedlist','link','image','video'],
plugins: ['fullscreen'],
toolbarFixedBox: true }

Craft Client 2.4.2692

  • Is it getting stripped on save, or when you toggle between Source/HTML view? – Brad Bell Sep 17 '15 at 19:39
  • Stripped on save. I'm starting to wonder if mod_security2 might be in play? This is reminiscent of problems I've had with Wordpress and mod_sec. – Marc Miller Sep 17 '15 at 22:28
  • I wouldn't be surprised. Maybe temporarily disable it to test? – Brad Bell Sep 17 '15 at 23:07
4

The answer here is to disable the mod_security2 rule on the admin folder as I was tripping the SQL Injection prevention rule (#300015) upon saving the Entry form.

This is a server setup that uses cPanel and Apache 2.2.

Edit file:

/usr/local/apache/conf/modsec2/whitelist.conf

Add the following rule:

<LocationMatch "/admin/">
  SecRuleRemoveById 300015
</LocationMatch>
  • 1
    This is super helpful! FWIW, I needed to disable both 300015 and 300016. Also, be sure to restart Apache to have the rules applied. – plaintxt Jun 6 '18 at 20:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.