Plugin Directory

Changeset 1526443


Ignore:
Timestamp:
11/02/2016 04:11:51 AM (9 years ago)
Author:
david273
Message:

Fixed nonce stopping add-on install

Location:
dojo/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • dojo/trunk/class-dojo.php

    r1526323 r1526443  
    256256        if ( isset( $_GET['_dojononce'] ) ) {
    257257            if ( ! wp_verify_nonce( $_GET['_dojononce'], $_GET['method'] ) ) {
    258                 wp_die();
     258                wp_die( 'Invalid request' );
    259259            }
    260260            $prefix = 'ajax_';
  • dojo/trunk/extensions/views/manage-extensions.php

    r1526323 r1526443  
    145145jQuery(function($) {
    146146
     147    var ajax_urls = {
     148        install_extension  : '<?php echo $this->ajax( 'install_extension' ) ?>',
     149        update_extension   : '<?php echo $this->ajax( 'update_extension' ) ?>',
     150        activate_extension : '<?php echo $this->ajax( 'activate_extension' ) ?>',
     151        remove_extension   : '<?php echo $this->ajax( 'remove_extension' ) ?>'
     152    };
     153
    147154    function doAction(action, context) {
    148155        var btn = context;
     
    151158        $('.dojo-error-container').hide();
    152159        var extension = btn.closest('.dojo-extension-block').attr('data-extension');
    153         var url = '<?php echo $this->ajax( '__ACTION__' ) ?>'.replace('__ACTION__', action);
     160        var url = ajax_urls[action];
    154161        $.post(url, { extension: extension }, function(response) {
    155162            if (response.indexOf('process_success') != -1) {
Note: See TracChangeset for help on using the changeset viewer.