Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/13/2013 07:45:27 PM (11 years ago)
Author:
r-a-y
Message:

Use network_site_url() to build the 'ajaxurl' JS variable.

Previously, for sites on HTTPS and using the 'FORCE_SSL_ADMIN' constant,
when viewing the frontend of the site on HTTP, the 'ajaxurl' JS
variable would still use HTTPS due to the usage of admin_url().

This would break most BP AJAX actions that use check_admin_referer() to
verify the nonce.

Switching admin_url() to use network_site_url() fixes this problem.

Fixes #4761. Props will_c.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-templates/bp-legacy/buddypress-functions.php

    r6740 r6790  
    279279        <script type="text/javascript" charset="utf-8">
    280280            /* <![CDATA[ */
    281             var ajaxurl = '<?php echo admin_url( 'admin-ajax.php' ); ?>';
     281            var ajaxurl = '<?php echo network_site_url( '/wp-admin/admin-ajax.php' ); ?>';
    282282            /* ]]> */
    283283        </script>
Note: See TracChangeset for help on using the changeset viewer.