From d09e4ff0209515cca58e1c502da648b5b86287da Mon Sep 17 00:00:00 2001 From: Phoenix Eve Aspacio Date: Wed, 11 Dec 2024 10:06:10 +0800 Subject: [PATCH] Convert AJAX to POST request This AJAX request sends form data in $_GET request query. This is problematic and unreliable when validating superrrr loooooong conditions, especially in environments that use reverse-proxy. Been having this problem and this PR solves it. :) --- data/web/js/site/mailbox.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/data/web/js/site/mailbox.js b/data/web/js/site/mailbox.js index af2862a37..018233673 100644 --- a/data/web/js/site/mailbox.js +++ b/data/web/js/site/mailbox.js @@ -179,9 +179,8 @@ $(document).ready(function() { // Get script_data textarea content from form the button was clicked in var script = $('textarea[name="script_data"]', $(this).parents('form:first')).val(); $.ajax({ - dataType: 'json', url: "/inc/ajax/sieve_validation.php", - type: "get", + type: "post", data: { script: script }, complete: function(data) { var response = (data.responseText);