summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/photos.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/controllers/photos.php')
-rw-r--r--modules/gallery/controllers/photos.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/gallery/controllers/photos.php b/modules/gallery/controllers/photos.php
index f052eccd..0d7daac4 100644
--- a/modules/gallery/controllers/photos.php
+++ b/modules/gallery/controllers/photos.php
@@ -74,12 +74,12 @@ class Photos_Controller extends Items_Controller {
if ($row = Database::instance()
->select(array("name", "slug"))
->from("items")
- ->where("parent_id", $photo->parent_id)
- ->where("id <>", $photo->id)
- ->open_paren()
- ->where("name", $form->edit_item->filename->value)
- ->orwhere("slug", $form->edit_item->slug->value)
- ->close_paren()
+ ->where("parent_id", "=", $photo->parent_id)
+ ->where("id", "<>", $photo->id)
+ ->and_open()
+ ->where("name", "=", $form->edit_item->filename->value)
+ ->orwhere("slug", "=", $form->edit_item->slug->value)
+ ->close()
->get()
->current()) {
if ($row->name == $form->edit_item->filename->value) {