diff mod_http_upload_external/share.php @ 2972:67d6510c5f49

mod_http_upload_external: Use a more widespread method to obtain Content-Length (thanks Yves)
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 30 Mar 2018 21:00:15 +0200
parents f86478a02b25
children 7036e82f83f5
line wrap: on
line diff
--- 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);