]> git.p6c8.net - jirafeau_project.git/commitdiff
fix wrong location for cfg access
authorgwunderlich <gwunderlich@cocus.com>
Fri, 2 Sep 2022 14:42:37 +0000 (16:42 +0200)
committerJérôme Jutteau <jerome@jutteau.fr>
Wed, 14 Dec 2022 09:06:46 +0000 (09:06 +0000)
index.php
lib/functions.php

index ae8f11bb62c8f63ed26269e88db8db82f81f2774..24565bdc3d64c81f56c509a6e0c33568fe084950 100644 (file)
--- a/index.php
+++ b/index.php
@@ -26,7 +26,7 @@ require(JIRAFEAU_ROOT . 'lib/functions.php');
 require(JIRAFEAU_ROOT . 'lib/lang.php');
 
 if ($cfg['download_password_requirement'] === "generated"){
-    $download_pass = jirafeau_gen_download_pass();
+    $download_pass = jirafeau_gen_download_pass($cfg['download_password_gen_len'], $cfg['download_password_gen_chars']);
 }
 
 check_errors($cfg);
index ebfffd41f7040f2be8beda0a0901259523d88026..f2a26e0858857031be5217987895c239463247fe 100644 (file)
@@ -101,10 +101,8 @@ function jirafeau_gen_random($l)
     return $code;
 }
 
-function jirafeau_gen_download_pass()
+function jirafeau_gen_download_pass($length, $allowed_chars)
 {
-    $length = $cfg['download_password_gen_len'];
-    $allowed_chars = $cfg['download_password_gen_chars'];
     if ($length <= 0) {
         return false;
     }

patrick-canterino.de