Skip to:
Content

BuddyPress.org

Changeset 6790


Ignore:
Timestamp:
02/13/2013 07:45:27 PM (12 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.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-cssjs.php

    r6620 r6790  
    151151?>
    152152
    153     <script type="text/javascript">var ajaxurl = '<?php echo admin_url( 'admin-ajax.php' ); ?>';</script>
     153    <script type="text/javascript">var ajaxurl = '<?php echo network_site_url( '/wp-admin/admin-ajax.php' ); ?>';</script>
    154154
    155155<?php
  • 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.