mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 01:33:36 +02:00
Just in case sanitize zonefile query
This commit is contained in:
parent
b18f450131
commit
e1d596f3d3
1 changed files with 2 additions and 4 deletions
|
@ -13,10 +13,8 @@ class ZonefileSetting < ActiveRecord::Base
|
|||
filename = "#{origin}.zone"
|
||||
|
||||
STDOUT << "#{Time.zone.now.utc} - Generating zonefile #{filename}\n"
|
||||
|
||||
zf = ActiveRecord::Base.connection.execute(
|
||||
"select generate_zonefile('#{origin}')"
|
||||
)[0]['generate_zonefile']
|
||||
sanitized_query = sanitize_sql("select generate_zonefile(?)", origin)
|
||||
zf = ActiveRecord::Base.connection.execute(sanitized_query)[0]['generate_zonefile']
|
||||
|
||||
File.open("#{ENV['zonefile_export_dir']}/#{filename}", 'w') { |f| f.write(zf) }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue