Skip to content

Commit

Permalink
LOWER() the slug and name in the find_dupes functions since DISTINCT
Browse files Browse the repository at this point in the history
is case sensitive, but our dupe validation is not.  Fixes ticket #1367.
  • Loading branch information
bharat committed Sep 12, 2010
1 parent 19034d1 commit a988416
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/gallery/helpers/gallery_task.php
Expand Up @@ -596,7 +596,7 @@ static function fix($task) {
static function find_dupe_slugs() {
return db::build()
->select_distinct(
array("parent_slug" => new Database_Expression("CONCAT(`parent_id`, ':', `slug`)")))
array("parent_slug" => new Database_Expression("CONCAT(`parent_id`, ':', LOWER(`slug`))")))
->select("id")
->select(array("C" => "COUNT(\"*\")"))
->from("items")
Expand All @@ -608,7 +608,7 @@ static function find_dupe_slugs() {
static function find_dupe_names() {
return db::build()
->select_distinct(
array("parent_name" => new Database_Expression("CONCAT(`parent_id`, ':', `name`)")))
array("parent_name" => new Database_Expression("CONCAT(`parent_id`, ':', LOWER(`name`))")))
->select("id")
->select(array("C" => "COUNT(\"*\")"))
->from("items")
Expand Down

0 comments on commit a988416

Please sign in to comment.