Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Upgrading SilverStripe

Ask questions about upgrading SilverStripe to the latest version.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Broken External Links - Not your average "Error Saving Content" error after upgrading


Reply

2 Posts   1158 Views

Avatar
quamsta

8 May 2010 at 8:08am (Last edited: 8 May 2010 8:31am), Community Member, 29 Posts

I upgraded a site to RC2 from 2.3.7 a while back and Saving/Publishing content seemed to worked fine. When 2.4.0 final came out, things still worked great. Yesterday however for whatever reason, my custom HTMLText/HTMLEditor fields appear to reject any content that contains an external link in it.

Whenever I attempt to save and publish content with external links, I get the red Error Saving Content message, and the response headers from FireBug are just baffling. I simply get a 404 response from http://mysite.mysubdomain.mydomain.net/admin/EditForm with a fully-dressed HTML Error page as content that corrupts the CMS. Without the external links, http://mysite.mysubdomain.mydomain.net/admin/EditForm is fine and my content gets saved and published.

My content is also saved and published in the default "Content" field perfectly fine even if I have an external link in it.

I went mad trying to solve this, and originally thought it was some externally-linked images I had in my custom fields, but I narrowed it down to just having any sort of valid internet protocol inside my custom HTML content fields. If I simply input "http://" or "ftp://" (or even gopher://, I shit you not) in the fields, I can't save the content. invalid protocols allow me to Save and Publish fine. "blah://", for example.

This is a relatively small site and my Page.php looks like this:

class Page extends SiteTree {
static $defaults = array(
);
static $db = array(
"Content2" =>"HTMLText"
);
static $has_one = array(
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Main', new HTMLEditorField('Content2));
return $fields;
}
}

Avatar
quamsta

9 May 2010 at 5:43pm Community Member, 29 Posts

Okay, this was due to my host enabling SecFilterScanPOST in Apache's mod_security module without telling me. X_X Not SilverStripe's fault at all!