]> git.p6c8.net - jirafeau_project.git/blobdiff - lib/functions.php
[TASK] Refactor server send limitation functions
[jirafeau_project.git] / lib / functions.php
index e23727413f7d4c35efb36c6479c852411d5c5142..01d0638d2db57e4a587959375aaa98530ab0c7e5 100644 (file)
@@ -204,7 +204,7 @@ function jirafeau_ini_to_bytes($value)
 function jirafeau_get_max_upload_size_bytes()
 {
     return min(jirafeau_ini_to_bytes(ini_get('post_max_size')),
-                jirafeau_ini_to_bytes(ini_get('upload_max_filesize')));
+               jirafeau_ini_to_bytes(ini_get('upload_max_filesize')));
 }
 
 /**
@@ -213,9 +213,7 @@ function jirafeau_get_max_upload_size_bytes()
  */
 function jirafeau_get_max_upload_size()
 {
-    return jirafeau_human_size(
-            min(jirafeau_ini_to_bytes(ini_get('post_max_size')),
-                 jirafeau_ini_to_bytes(ini_get('upload_max_filesize'))));
+    return jirafeau_human_size(jirafeau_get_max_upload_size_bytes());
 }
 
 /**
@@ -597,7 +595,7 @@ function jirafeau_admin_list($name, $file_hash, $link_hash)
                 }
 
                 /* Filter. */
-                if (!empty($name) && !preg_match("/$name/i", jirafeau_escape($l['file_name']))) {
+                if (!empty($name) && !@preg_match("/$name/i", jirafeau_escape($l['file_name']))) {
                     continue;
                 }
                 if (!empty($file_hash) && $file_hash != $l['md5']) {

patrick-canterino.de