Skip to content

Commit

Permalink
Allow albums to have two (or more) dots in the name. Fixes #1897.
Browse files Browse the repository at this point in the history
  • Loading branch information
bharat committed Jul 21, 2012
1 parent a98afdb commit 6d9d6a2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/gallery/models/item.php
Expand Up @@ -806,7 +806,7 @@ public function valid_name(Validation $v, $field) {

// Do not accept files with double extensions, they can cause problems on some
// versions of Apache.
if (substr_count($this->name, ".") > 1) {
if (!$this->is_album() && substr_count($this->name, ".") > 1) {
$v->add_error("name", "illegal_data_file_extension");
}

Expand Down
6 changes: 6 additions & 0 deletions modules/gallery/tests/Item_Model_Test.php
Expand Up @@ -520,4 +520,10 @@ public function cant_rename_to_illegal_extension_test() {
$this->assert_true(false, "Shouldn't get here");
}
}

public function albums_can_have_two_dots_in_name_test() {
$album = test::random_album_unsaved(item::root());
$album->name = $album->name . ".foo.bar";
$album->save();
}
}

0 comments on commit 6d9d6a2

Please sign in to comment.