WordPress.org

Forums

WP FullCalendar
Events do not appear in IE 8 & 9 when admin and frontend schemes are different (4 posts)

  1. Dylan Barlett
    Member
    Posted 1 year ago #

    When FORCE_SSL_ADMIN is true, admin_url() returns an HTTPS URL. If is_ssl() is false (i.e. the frontend page is accessed over HTTP), there is a scheme mismatch that prevents the call to admin-ajax.php from working in IE 8 & 9. This is a limitation of XDomainRequest used in IE < 10 - see #7 on http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx.

    Steps to reproduce (WP FullCalendar 0.8.4):

    1. Add define('FORCE_SSL_ADMIN', true); to wp-config.php
    2. Add [fullcalendar] to a page
    3. View page over HTTP in Chrome or Firefox - events appear
    4. View page over HTTP in IE 8 or 9 - events do not appear
    5. View page over HTTPS in IE 8 or 9 - events appear

    Fix: modify localize_script() in wp-fullcalendar.php:

    //$js_vars['ajaxurl'] = admin_url('admin-ajax.php');
    if( is_ssl() ) {
        $js_vars['ajaxurl'] = admin_url('admin-ajax.php', 'https');
    } else {
        $js_vars['ajaxurl'] = admin_url('admin-ajax.php', 'http');
    }

    https://wordpress.org/plugins/wp-fullcalendar/

  2. Dylan Barlett
    Member
    Posted 8 months ago #

    This can be filtered in your theme or plugin instead:

    add_filter( 'wpfc_js_vars', 'my_wpfc_js_vars', 10, 1 );
    function my_wpfc_js_vars( $js_vars ) {
    	if ( is_ssl() ) {
    		$js_vars['ajaxurl'] = admin_url( 'admin-ajax.php', 'https' );
    	} else {
    		$js_vars['ajaxurl'] = admin_url( 'admin-ajax.php', 'http' );
    	}
    	return $js_vars;
    }
  3. Dylan Barlett
    Member
    Posted 8 months ago #

    Simpler version:

    add_filter( 'wpfc_js_vars', 'my_wpfc_js_vars', 10, 1 );
    function my_wpfc_js_vars( $js_vars ) {
    	$js_vars['ajaxurl'] = set_url_scheme( $js_vars['ajaxurl'], null );
    	return $js_vars;
    }
  4. angelo
    NetWebLogic Support
    Posted 8 months ago #

    Thanks, Im going to let the devs know about this.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP FullCalendar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic