changeset 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 c89be016a075
children a457fff04f1d
files mod_http_upload_external/share.php
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
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);