mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-06-01 01:09:20 -04:00
Smash multiple extensions down into a single one when accepting file
uploads. Fixes #1872.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user