diff --git a/web/file_manager/fm_api.php b/web/file_manager/fm_api.php index 4a4dd9ec..c593b3f6 100644 --- a/web/file_manager/fm_api.php +++ b/web/file_manager/fm_api.php @@ -3,15 +3,7 @@ //error_reporting(NULL); // Preventing CSRF -if ($_SERVER['REQUEST_METHOD']=='POST') { - $host_arr=explode(":", $_SERVER['HTTP_HOST']); - $hostname=$host_arr[0]; - $port = $_SERVER['SERVER_PORT']; - $expected_http_origin="https://".$hostname.":".$port; - if ($_SERVER['HTTP_ORIGIN'] != $expected_http_origin) { - die ("Nope."); - } -} +prevent_post_csrf(true); header('Content-Type: application/json');