| Server IP : 213.186.33.4 / Your IP : 216.73.216.146 Web Server : Apache System : Linux webm005.cluster103.gra.hosting.ovh.net 6.18.39-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Tue Jul 21 12:03:15 CEST 2026 x86_64 User : karinebmkh ( 644538) PHP Version : 8.4.22 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/karinebmkh/www2/wp-content/plugins/mailchimp-for-wp/includes/forms/ |
Upload File : |
<?php
class MC4WP_Form_Previewer
{
public function add_hooks()
{
add_action('parse_request', array( $this, 'listen' ));
}
public function listen()
{
if (empty($_GET['mc4wp_preview_form'])) {
return;
}
try {
$form = mc4wp_get_form($_GET['mc4wp_preview_form']);
} catch (Exception $e) {
return;
}
show_admin_bar(false);
add_filter('pre_handle_404', '__return_true');
remove_all_actions('template_redirect');
add_action('template_redirect', array( $this, 'load_preview' ));
}
public function load_preview()
{
// clear output, some plugin or hooked code might have thrown errors by now.
if (ob_get_level() > 0) {
ob_end_clean();
}
$form_id = (int) $_GET['mc4wp_preview_form'];
status_header(200);
require dirname(__FILE__) . '/views/preview.php';
exit;
}
}