diff --git a/.htaccess b/.htaccess index 714e49b..9837be1 100644 --- a/.htaccess +++ b/.htaccess @@ -37,4 +37,10 @@ Options -Indexes Header set X-Content-Type-Options "nosniff" Header set X-Frame-Options "SAMEORIGIN" Header set X-XSS-Protection "1; mode=block" + + +# Bloquer l'accès direct aux images privées + + RewriteEngine On + RewriteRule ^liste_albums_prives/.+\.(jpg|jpeg|png|gif)$ - [F] \ No newline at end of file diff --git a/arbre-img-prive.php b/arbre-img-prive.php index 617ca7c..661669b 100644 --- a/arbre-img-prive.php +++ b/arbre-img-prive.php @@ -228,7 +228,10 @@ $config = getSiteConfig();
getPathname(), strlen(realpath('./')))); - $url = $baseUrl . '/' . ltrim($relativePath, '/'); + $url = $baseUrl . '/images.php?path=' . urlencode($file->getPathname()) . '&key=' . urlencode($shareKey); // Vérifier que le fichier existe et est accessible if (file_exists($file->getPathname())) { $images[] = $url; @@ -148,7 +148,7 @@ $config = getSiteConfig(); } ?>