Forum Replies Created

Viewing 1 replies (of 1 total)
  • We still have problems with the media gallery but I found a workaround.

    In wp-admin/admin-ajax.php is a check for ‘$_REQUEST[‘action’]’, if that is empty it will die. In your plugin on lines 51+52 $_POST[‘action’] and ‘client_action’ are replaced with a cleaned up version. It seems that sometimes these are empty, resulting in an empty $_REQUEST[‘action’] letting admin-ajax.php die. I don’t know why $_POST is empty in the media gallery, as it is definitely sent via POST but I added a check to your plugin to see if $_POST[‘action’] is empty, and if it is, it will use $_REQUEST[‘action’] as source for the cleanup.

    variables_order is GPCS, request_order GP

    The code:

    if($_POST['action'])
                $_POST['action'] = preg_replace('/[^a-zA-Z_\-0-9]/i', '', $_POST['action']);
            else
                $_POST['action'] = preg_replace('/[^a-zA-Z_\-0-9]/i', '', $_REQUEST['action']);
            if($_POST['client_action'])
                $_POST['client_action'] = preg_replace('/[^a-zA-Z_\-0-9]/i', '', $_POST['client_action']);
            else
                $_POST['client_action'] = preg_replace('/[^a-zA-Z_\-0-9]/i', '', $_REQUEST['client_action']);

Viewing 1 replies (of 1 total)