cforms v14.6 – switching to custom CSS 403 error

Quick Notes:
TL;DR – When activating a custom CSS from the folder:
/plugins/cforms-custom/[your-css-file].css
You get a 403 error while running WordPress 4.

The issue seems to be in: cforms-css.php
~Line: 142:
Change:¬†echo ‘<option style=”background:#fbd0d3″ selected=”selected” value=”../../cforms-custom/’.$f.'”>’.$f.'</option>’.”\n”;
To: (removing one of the ../)
echo ‘<option style=”background:#fbd0d3″ selected=”selected” value=”../cforms-custom/’.$f.'”>’.$f.'</option>’.”\n”;

Then again on ~Line: 144:
echo ‘<option value=”../../cforms-custom/’.$f.'”>’.$f.'</option>’;
To: (removing one of the ../)
echo ‘<option value=”../cforms-custom/’.$f.'”>’.$f.'</option>’;

This then causes an issue on the frontend. To fix this:

edit: cforms.php

Replace the following (~Line 1209):

if( $cformsSettings[‘global’][‘cforms_no_css’]<>’1′ )
echo ‘<link rel=”stylesheet” type=”text/css” href=”‘ . $cforms_root . ‘/styling/’ . $cformsSettings[‘global’][‘cforms_css’] . ‘” />’.”\n”;

With:

if( $cformsSettings[‘global’][‘cforms_no_css’]<>’1′ ){
if (strpos($cformsSettings[‘global’][‘cforms_css’],’cforms-custom’) !== false) {
$cformsCSSpath = “/”;
}else{
$cformsCSSpath = ‘/styling/’;
}
echo ‘<link rel=”stylesheet” type=”text/css” href=”‘ . $cforms_root . $cformsCSSpath . $cformsSettings[‘global’][‘cforms_css’] . ‘” />’.”\n”;
}

 

 

I hope that helps someone.

 

This doesn’t appear to work on both the front and the back end…

Leave a Reply

Your email address will not be published. Required fields are marked *