diff options
| author | Nathan Kinkade <nath@nkinka.de> | 2012-06-01 15:10:46 +0000 |
|---|---|---|
| committer | Nathan Kinkade <nath@nkinka.de> | 2012-06-01 15:10:46 +0000 |
| commit | b52e834bd0bab530e98537d52b31d4b37f199739 (patch) | |
| tree | ff31dd4f6c2afaeae380f10dc691cde3cb4e6739 /modules/gallery/models | |
| parent | f5098f54b8279f468d94747b1156e15ea05d6d25 (diff) | |
| parent | 4c98b218316df00c8bf3eeb28a8324ec64348bff (diff) | |
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/gallery/models')
| -rw-r--r-- | modules/gallery/models/item.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index 98a2c4df..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); @@ -833,6 +841,11 @@ class Item_Model_Core extends ORM_MPTT { $v->add_error("name", "conflict"); return; } + + if ($this->parent_id == 1 && Kohana::auto_load("{$this->slug}_Controller")) { + $v->add_error("slug", "reserved"); + return; + } } /** |
