]> git.p6c8.net - jirafeau/jirafeau.git/blobdiff - index.php
More character scaping on indes and install.
[jirafeau/jirafeau.git] / index.php
index 435e059711db7532e24bb67c6c8ef37f1c5dee49..74c68a059aeb79e83cb90076b7c13062475f37c2 100644 (file)
--- a/index.php
+++ b/index.php
@@ -25,7 +25,9 @@ require(JIRAFEAU_ROOT . 'lib/settings.php');
 require(JIRAFEAU_ROOT . 'lib/functions.php');
 require(JIRAFEAU_ROOT . 'lib/lang.php');
 
-if ($cfg['download_password_requirement'] === "generated") {
+$download_pass = null;
+
+if ($cfg['download_password_requirement'] === 'generated') {
     $download_pass = jirafeau_gen_download_pass($cfg['download_password_gen_len'], $cfg['download_password_gen_chars']);
 }
 
@@ -102,7 +104,7 @@ elseif (true === jirafeau_challenge_upload_ip($cfg, get_ip_address($cfg))) {
 
 ?>
 
-<?php jirafeau_create_upload_finished_box($cfg['preview']); ?>
+<?php jirafeau_create_upload_finished_box($cfg['preview'], $download_pass); ?>
 
 <div id="uploading">
     <p>
@@ -156,7 +158,7 @@ if ($cfg['download_password_requirement'] === 'generated') {
     echo '<tr><td><label for="input_key">' . t('PSW') . ':' . '</label></td>';
     echo '<td><input type="password" name="key" id="input_key" autocomplete = "new-password"';
     if ($cfg['download_password_policy'] === 'regex') {
-        echo ' pattern="' . substr($cfg['download_password_policy_regex'], 1, strlen($cfg['download_password_policy_regex']) - 2) . '"'; //remove php delimiters
+        echo ' pattern="' . jirafeau_escape(substr($cfg['download_password_policy_regex'], 1, strlen($cfg['download_password_policy_regex']) - 2)) . '"'; //remove php delimiters
     }
     if ($cfg['download_password_requirement'] === 'required') {
         echo ' required';

patrick-canterino.de