Skip to content

Commit 1bf4266

Browse files
committed
sanitize project condition
1 parent e5f9243 commit 1bf4266

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

modules/backlogs/app/services/work_packages/rebuild_positions_service.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ def initialize(project: nil)
3434
end
3535

3636
def call
37-
condition = " AND work_packages.project_id = #{@project.id}" if @project
37+
condition = if @project
38+
::OpenProject::SqlSanitization.sanitize " AND work_packages.project_id = :project_id",
39+
project_id: @project.id
40+
end
3841

3942
WorkPackage.connection.execute <<~SQL.squish
4043
UPDATE work_packages

0 commit comments

Comments
 (0)