diff options
| author | Tim Almdal <tnalmdal@shaw.ca> | 2009-10-13 11:48:42 -0700 |
|---|---|---|
| committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-10-13 11:48:42 -0700 |
| commit | d9720b77e9c4455df3e3237c285ad5a33afdd591 (patch) | |
| tree | 2d2d7f918b9e7af7d312d7bc08f05fce0e4c528f /modules/gallery/controllers/photos.php | |
| parent | 4dd6e4cc4c3353b36a5c69a845ad879ddf085d2f (diff) | |
| parent | 53393a144609c0d8402b14606f52422bf3f28daf (diff) | |
Merge branch 'master' into talmdal_dev
Conflicts:
modules/gallery/controllers/admin_users.php
modules/gallery/controllers/password.php
modules/gallery/helpers/group.php
modules/gallery/helpers/user.php
modules/notification/helpers/notification.php
Diffstat (limited to 'modules/gallery/controllers/photos.php')
| -rw-r--r-- | modules/gallery/controllers/photos.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/modules/gallery/controllers/photos.php b/modules/gallery/controllers/photos.php index 81e7519e..fbff53ce 100644 --- a/modules/gallery/controllers/photos.php +++ b/modules/gallery/controllers/photos.php @@ -63,7 +63,17 @@ class Photos_Controller extends Items_Controller { $form = photo::get_edit_form($photo); $valid = $form->validate(); - if ($valid = $form->validate()) { + + if ($valid) { + $new_ext = pathinfo($form->edit_item->filename->value, PATHINFO_EXTENSION); + $old_ext = pathinfo($photo->name, PATHINFO_EXTENSION); + if (strcasecmp($new_ext, $old_ext)) { + $form->edit_item->filename->add_error("illegal_extension", 1); + $valid = false; + } + } + + if ($valid) { if ($form->edit_item->filename->value != $photo->name || $form->edit_item->slug->value != $photo->slug) { // Make sure that there's not a name or slug conflict |
