]> git.p6c8.net - jirafeau/jirafeau.git/blobdiff - script.php
Updated CHANGELOG
[jirafeau/jirafeau.git] / script.php
index 6ef117ed13ee5c0a9c1b5417e7ef3a99a5326fee..ae574494bf2165f2698c96b06b4f28773be762db 100644 (file)
@@ -1,7 +1,9 @@
 <?php
 /*
  *  Jirafeau, your web file repository
 <?php
 /*
  *  Jirafeau, your web file repository
+ *  Copyright (C) 2008  Julien "axolotl" BERNARD <axolotl@magieeternelle.org>
  *  Copyright (C) 2015  Jerome Jutteau <jerome@jutteau.fr>
  *  Copyright (C) 2015  Jerome Jutteau <jerome@jutteau.fr>
+ *  Copyright (C) 2024  Jirafeau project <https://gitlab.com/jirafeau> (see AUTHORS.md)
  *
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU Affero General Public License as
  *
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU Affero General Public License as
@@ -72,7 +74,7 @@ if (isset($_FILES['file']) && is_writable(VAR_FILES)
             !jirafeau_challenge_upload($cfg, get_ip_address($cfg), $_POST['upload_password'])) {
             echo 'Error 3: Invalid password';
             exit;
             !jirafeau_challenge_upload($cfg, get_ip_address($cfg), $_POST['upload_password'])) {
             echo 'Error 3: Invalid password';
             exit;
-        } elseif (!jirafeau_challenge_upload($cfg, get_ip_address($cfg), null)) {
+        } elseif (!isset($_POST['upload_password']) && !jirafeau_challenge_upload($cfg, get_ip_address($cfg), null)) {
             echo 'Error 2: No password nor allowed IP';
             exit;
         }
             echo 'Error 2: No password nor allowed IP';
             exit;
         }
@@ -173,7 +175,7 @@ if (isset($_FILES['file']) && is_writable(VAR_FILES)
     }
     if (strlen($d) > 0 && $d == $link['link_code']) {
         jirafeau_delete_link($link_name);
     }
     if (strlen($d) > 0 && $d == $link['link_code']) {
         jirafeau_delete_link($link_name);
-        echo "Ok";
+        echo 'Ok';
         exit;
     }
     if ($link['time'] != JIRAFEAU_INFINITY && time() > $link['time']) {
         exit;
     }
     if ($link['time'] != JIRAFEAU_INFINITY && time() > $link['time']) {
@@ -215,8 +217,8 @@ if (isset($_FILES['file']) && is_writable(VAR_FILES)
 } elseif (isset($_GET['get_version'])) {
     echo JIRAFEAU_VERSION;
 } elseif (isset($_GET['lang'])) {
 } elseif (isset($_GET['get_version'])) {
     echo JIRAFEAU_VERSION;
 } elseif (isset($_GET['lang'])) {
-    $l=$_GET['lang'];
-    if ($l == "bash") {
+    $l = $_GET['lang'];
+    if ($l == 'bash') {
         ?>
 #!/bin/bash
 
         ?>
 #!/bin/bash
 
@@ -318,7 +320,7 @@ downloadpage='f.php'
 
 if [ "$1" == "send" ]; then
     if [ ! -f "$2" ]; then
 
 if [ "$1" == "send" ]; then
     if [ ! -f "$2" ]; then
-        echo "File \"$2\" does not exists."
+        echo "File \"$2\" does not exist."
         exit
     fi
 
         exit
     fi
 

patrick-canterino.de