瀏覽代碼

Add warning to help understand bug of post_max_size.

Laurent Destailleur 4 年之前
父節點
當前提交
0e80784de9
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8 2
      htdocs/core/actions_linkedfiles.inc.php

+ 8 - 2
htdocs/core/actions_linkedfiles.inc.php

@@ -26,8 +26,14 @@
 //var_dump($upload_dir);
 //var_dump($upload_dirold);
 
-if (GETPOST('uploadform', 'int') && empty($_FILES)) {
-	print "Error: The PHP parameter 'post_max_size' is too low. All POST parameters and FILES were set to empty.\n";
+
+// Protection to understand what happen when submitting files larger than post_max_size
+if (GETPOST('uploadform', 'int') && empty($_POST) && empty($_FILES)) {
+	dol_syslog("The PHP parameter 'post_max_size' is too low. All POST parameters and FILES were set to empty.");
+	$langs->loadLangs(array("errors", "install"));
+	print $langs->trans("ErrorFileSizeTooLarge").' ';
+	print $langs->trans("ErrorGoBackAndCorrectParameters");
+	die;
 }
 
 // Submit file/link