Bladeren bron

Fix issue with SCORM upload file sizing - refs BT#10012

Yannick Warnier 9 jaren geleden
bovenliggende
commit
e39ceab4e9
1 gewijzigde bestanden met toevoegingen van 10 en 0 verwijderingen
  1. 10 0
      main/newscorm/learnpath.class.php

+ 10 - 0
main/newscorm/learnpath.class.php

@@ -9814,7 +9814,17 @@ EOD;
     public function verify_document_size($s)
     {
         $post_max = ini_get('post_max_size');
+        if (substr($post_max, -1, 1) == 'M') {
+            $post_max = intval(substr($post_max, 0, -1)) * 1024 * 1024;
+        } elseif (substr($post_max, -1, 1) == 'G') {
+            $post_max = intval(substr($post_max, 0, -1)) * 1024 * 1024 * 1024;
+        }
         $upl_max = ini_get('upload_max_filesize');
+        if (substr($upl_max, -1, 1) == 'M') {
+            $upl_max = intval(substr($upl_max, 0, -1)) * 1024 * 1024;
+        } elseif (substr($upl_max, -1, 1) == 'G') {
+            $upl_max = intval(substr($upl_max, 0, -1)) * 1024 * 1024 * 1024;
+        }
         $documents_total_space = DocumentManager::documents_total_space();
         $course_max_space = DocumentManager::get_course_quota();
         $total_size = filesize($s) + $documents_total_space;