Allow albums to have two (or more) dots in the name. Fixes #1897.

This commit is contained in:
Bharat Mediratta
2012-07-21 15:01:31 -07:00
parent a98afdb32c
commit 6d9d6a2e5d
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -806,7 +806,7 @@ class Item_Model_Core extends ORM_MPTT {
// 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");
}
@@ -520,4 +520,10 @@ class Item_Model_Test extends Gallery_Unit_Test_Case {
$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();
}
}