# HG changeset patch # User Emmanuel Gil Peyrot # Date 1522436415 -7200 # Node ID 67d6510c5f496caeb50adf8dd779551e0a8c8083 # Parent c89be016a0755bd7cddc1d51771ee3221987802e mod_http_upload_external: Use a more widespread method to obtain Content-Length (thanks Yves) diff -r c89be016a075 -r 67d6510c5f49 mod_http_upload_external/share.php --- a/mod_http_upload_external/share.php Fri Mar 30 13:41:56 2018 +0200 +++ b/mod_http_upload_external/share.php Fri Mar 30 21:00:15 2018 +0200 @@ -70,9 +70,7 @@ $request_method = $_SERVER['REQUEST_METHOD']; if(array_key_exists('v', $_GET) === TRUE && $request_method === 'PUT') { - $headers = getallheaders(); - - $upload_file_size = $headers['Content-Length']; + $upload_file_size = $_SERVER['HTTP_CONTENT_LENGTH']; $upload_token = $_GET['v']; $calculated_token = hash_hmac('sha256', "$upload_file_name $upload_file_size", $CONFIG_SECRET);