diff options
Diffstat (limited to 'modules/gallery/models/item.php')
-rw-r--r-- | modules/gallery/models/item.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index 992af0cc..903dadad 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -797,11 +797,19 @@ class Item_Model_Core extends ORM_MPTT { if (strpos($this->name, "/") !== false) { $v->add_error("name", "no_slashes"); return; - } else if (rtrim($this->name, ".") !== $this->name) { + } + + if (rtrim($this->name, ".") !== $this->name) { $v->add_error("name", "no_trailing_period"); return; } + // Do not accept files with double extensions, they can cause problems on some + // versions of Apache. + if (substr_count($this->name, ".") > 1) { + $v->add_error("name", "illegal_data_file_extension"); + } + if ($this->is_movie() || $this->is_photo()) { $ext = pathinfo($this->name, PATHINFO_EXTENSION); |