Iframe code gets deleted from HTML element

The following code just gets deleted from the HTML field in the lastes version of gf - with previous ones it worked!

<iframe src="https://shorturl.4myhealth.org/rd/2472a820-eb48-11ed-b4f4-63a68c310db7"  scrolling="no" style=" width:100%; height: 500px;  overflow: hidden;" ></iframe>

So it is an HTML field and the iframe needs to be loaded conditionally that is why I put it in the content. After saving it it is still there but on reload of the form editor it is gone.

Hello. There was a bug introduced as part of some security enhancements in Gravity Forms 2.7.5. It will be fixed by the product team in the next release. For the meantime, you can add this PHP to your site to prevent the issue:

add_filter( 'gform_disable_form_settings_sanitization', function( $disable_sanitization ) {

    GFCommon::log_debug( current_filter() . ": running hotfix for GH#3612" );
    $disable_sanitization = current_user_can( 'unfiltered_html' ) ? true : false;
    return $disable_sanitization;
    
} );

This is PHP code that can be added to your theme functions.php file, or you can use a plugin such as this one to keep the code separate from the theme: Code Snippets – WordPress plugin | WordPress.org

Please see this article for additional information on placing PHP snippets: https://docs.gravityforms.com/where-do-i-put-this-code/#h-php

Thank you.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.