Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fixed brakeman offence, possible SQL injection

Damian Legawiece560292e6fe0
diff --git a/core/app/models/spree/taxon.rb b/core/app/models/spree/taxon.rb
index e07877b6f4..a366deaf9a 100644
--- a/core/app/models/spree/taxon.rb
+++ b/core/app/models/spree/taxon.rb
@@ -93,9 +93,9 @@ module Spree
if Spree.use_translations?
joins(:taxonomy).
join_translation_table(Taxonomy).
- where(["LOWER(#{Taxonomy.translation_table_alias}.name) = ?", taxonomy_name.downcase.strip])
+ where(Taxonomy.translation_table_alias.arel_table[:name].lower.eq(taxonomy_name.downcase.strip))
else
- joins(:taxonomy).where(["LOWER(#{Spree::Taxonomy.table_name}.name) = ?", taxonomy_name.downcase.strip])
+ joins(:taxonomy).where(Spree::Taxonomy.arel_table[:name].lower.eq(taxonomy_name.downcase.strip))
end
}