CF7 / Really Simple Captha and HTTPS/SSL
-
I noticed that using Contact Form 7 with a Really Simple Captcha on the form placed on a SSL page attempts to load the image from a https:// only URL, triggering unsafe content notices in some browsers.
This can be easily improved by editing the wpcf7_upload_dir() function in cf7/includes/functions.php to take SSL into account:
function wpcf7_upload_dir( $type = false ) { $uploads = wp_upload_dir(); $uploads = apply_filters( 'wpcf7_upload_dir', array( 'dir' => $uploads['basedir'], 'url' => $uploads['baseurl'] ) ); // SSL mod if (is_ssl()): $uploads['url'] = str_replace("https://","https://",$uploads['url']); endif; // end SSL mod if ( 'dir' == $type ) return $uploads['dir']; if ( 'url' == $type ) return $uploads['url']; return $uploads; }
I’m sure this can be done better or safer, but this worked for me.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘CF7 / Really Simple Captha and HTTPS/SSL’ is closed to new replies.