Search code examples
jquerycssformssslwufoo

Linking Wufoo to an external stylesheet without SSL


I'm using Wufoo with an external stylesheet stored on my server (just http://, not https://).

However, because the default short code generated with Wufoo is set to SSL = 'true' like this... [wufoo username="xxx" formhash="xxx" autoresize="true" height="765" header="show" ssl="true"] certain browsers throw up an error saying that insecure content is being loaded e.g. Chrome and IE9. This issue has been reported here - http://wufoo.com/forums/discussion/3815/theme-advanced-your-css-file-on-the-web-big-issue-with-ie9-browser/p1

My question is - is there a way to turn off Wufoo SSL by default so that visitors don't get this error? I'm not particularly bothered about the SSL part - it's not that confidential. Alternatively can I use jQuery to change SSL='true' to SSL='false' in the source code?

p.s. I know I can modify the embed code manually to turn off SSL (as per this doc http://www.wufoo.com/docs/url-modifications/#format) but that's out of the question, with casual users embedding the form every day.


Solution

  • For anyone struggling with this issue what I have done is replace the SSL string in PHP (since I am using WordPress).

    It's probably not the best solution since I am removing SSL, but since the data is not extremely confidential I can live with it.

    <!-- Get Custom Field data (or content, etc.). In this case the custom field is called 'true'-->
    <?php $ID = $post_id['ID']; ?>
    <?php $custom = get_post_meta($post->ID, 'test', true); ?>              
    
    <!-- Strip out SSL because it causes loading issues in IE9 and Chrome (since it is loading the stylesheet from a non-secure address). -->
    <?php $withoutssl = str_replace('ssl="true"','ssl="false"', $custom); ?>
    
    <!-- Apply formatting. -->
    <?php $formatted = apply_filters('the_content', $withoutssl); ?>
    
    <!-- Output the Custom Field. -->
    <?php echo $formatted ?>