summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/g2_import/views/admin_g2_import.html.php4
-rw-r--r--modules/gallery/models/item.php13
2 files changed, 13 insertions, 4 deletions
diff --git a/modules/g2_import/views/admin_g2_import.html.php b/modules/g2_import/views/admin_g2_import.html.php
index 5bac9e9e..ddd7c26f 100644
--- a/modules/g2_import/views/admin_g2_import.html.php
+++ b/modules/g2_import/views/admin_g2_import.html.php
@@ -16,10 +16,10 @@
<?= t("Permissions are <b>not imported</b>. You will have to set them again manually (for now).") ?>
</li>
<li>
- <?= t("The only supported image formats are JPG, PNG and GIF. Other formats will be skipped.") ?>
+ <?= t("The only supported file formats are JPG, PNG and GIF, FLV and MP4. Other formats will be skipped.") ?>
</li>
<li>
- <?= t("The only supported movie formats are FLV and MP4. Other formats will be skipped.") ?>
+ <?= t("Deactivating the <b>notification</b>, <b>search</b> and <b>exif</b> modules during your import will make it go faster.") ?>
</li>
<li>
<?= t("The eAccelerator PHP performance extension is known to cause issues. If you're using eAccelerator and having problems, please disable it while you do your import. One way to do that is to put <code>php_value eaccelerator.enable 0</code> in gallery3/.htaccess") ?>
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php
index e3d27b6d..2d62c386 100644
--- a/modules/gallery/models/item.php
+++ b/modules/gallery/models/item.php
@@ -76,9 +76,18 @@ class Item_Model extends ORM_MPTT {
parent::delete();
if (is_dir($path)) {
+ // Take some precautions against accidentally deleting way too much
+ $delete_resize_path = dirname($resize_path);
+ $delete_thumb_path = dirname($thumb_path);
+ if ($delete_resize_path == VARPATH . "resizes" ||
+ $delete_thumb_path == VARPATH . "thumbs" ||
+ $path == VARPATH . "albums") {
+ throw new Exception(
+ "@todo DELETING_TOO_MUCH ($delete_resize_path, $delete_thumb_path, $path)");
+ }
@dir::unlink($path);
- @dir::unlink(dirname($resize_path));
- @dir::unlink(dirname($thumb_path));
+ @dir::unlink($delete_resize_path);
+ @dir::unlink($delete_thumb_path);
} else {
@unlink($path);
@unlink($resize_path);