ah oui c'est comme ça
This commit is contained in:
parent
1a5b090f53
commit
4bc1e11c94
2 changed files with 4 additions and 3 deletions
4
bdd.php
4
bdd.php
|
@ -103,12 +103,12 @@ function saveFilesFromPost($postData,$id_ensemble) {
|
||||||
foreach ($_FILES as $file) {
|
foreach ($_FILES as $file) {
|
||||||
$safe_type = checkFileTypeSecure($file['tmp_name']);
|
$safe_type = checkFileTypeSecure($file['tmp_name']);
|
||||||
|
|
||||||
// Create a unique filename to avoid overwriting existing files
|
|
||||||
$uniqueFileName = uniqid() . '_' . $fileName;
|
|
||||||
|
|
||||||
// Extract file information
|
// Extract file information
|
||||||
if (isset($file['name'])){
|
if (isset($file['name'])){
|
||||||
$fileName = htmlspecialchars($file['name']);
|
$fileName = htmlspecialchars($file['name']);
|
||||||
|
// Create a unique filename to avoid overwriting existing files
|
||||||
|
$uniqueFileName = uniqid() . '_' . $fileName;
|
||||||
// le dernier check est pour autoriser l'upload de fichiers html aux admins
|
// le dernier check est pour autoriser l'upload de fichiers html aux admins
|
||||||
if(!check_ext($fileName) || $safe_type == 0 || ($safe_type == 5 && !$_SESSION["admin"])){
|
if(!check_ext($fileName) || $safe_type == 0 || ($safe_type == 5 && !$_SESSION["admin"])){
|
||||||
echo(json_encode(["status"=>"0","msg"=>"le fichier '$fileName' n'a pas passé les filtres de contenu. ( dommaaaaggee :c )"]));
|
echo(json_encode(["status"=>"0","msg"=>"le fichier '$fileName' n'a pas passé les filtres de contenu. ( dommaaaaggee :c )"]));
|
||||||
|
|
|
@ -34,6 +34,8 @@
|
||||||
<a href="inscription.php" class="button color-red-tr" id="btn-connection">S'inscrire</a>
|
<a href="inscription.php" class="button color-red-tr" id="btn-connection">S'inscrire</a>
|
||||||
<a href="connection.php" class="button color-red-tr" id="btn-connection">Se connecter</a>
|
<a href="connection.php" class="button color-red-tr" id="btn-connection">Se connecter</a>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,7 +51,6 @@
|
||||||
}?>
|
}?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<div id="user_status">
|
<div id="user_status">
|
||||||
|
|
Loading…
Reference in a new issue