Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/authorize_net/api/LogHelper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ def initialize()
begin
filepath = './LogConfig.yml'
if(File.file?(filepath))
cnf = YAML::load(File.open(filepath))
cnf = YAML.safe_load(File.open(filepath))
if(@@loglevels.include? cnf['loglevel'].downcase)
@@shouldLog = true
@logger = Logger.new(cnf['filepath'])
@logger.level = LogLevelMapper(cnf['loglevel'].downcase)
if(cnf['maskSensitiveData'])
@logger.formatter = SensitiveDataFilter.new
else
constants = YAML.load_file(File.dirname(__FILE__) + "/constants.yml")
constants = YAML.safe_load_file(File.dirname(__FILE__) + "/constants.yml")
@logger.formatter = proc do |severity, datetime, progname, msg|
progname = constants['clientId']
date_format = datetime.strftime("%Y-%m-%d %H:%M:%S")
Expand Down
2 changes: 1 addition & 1 deletion lib/authorize_net/api/SensitiveDataFilter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def maskSensitiveXmlString(input)
end

def formatLogEntry(severity, time, progname, msg)
constants = YAML.load_file(File.dirname(__FILE__) + "/constants.yml")
constants = YAML.safe_load_file(File.dirname(__FILE__) + "/constants.yml")
progname = constants['clientId']
date_format = time.strftime("%Y-%m-%d %H:%M:%S")
if severity == "INFO" or severity == "WARN"
Expand Down
2 changes: 1 addition & 1 deletion lib/authorize_net/api/api_transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def make_request(request, responseClass, type)
def serialize(object, type)
doc = Nokogiri::XML::Document.new
doc.root = object.to_xml
constants = YAML.load_file(File.dirname(__FILE__) + "/constants.yml")
constants = YAML.safe_load_file(File.dirname(__FILE__) + "/constants.yml")
clientId = constants['clientId']

builder = Nokogiri::XML::Builder.new(encoding: 'utf-8') do |x|
Expand Down
2 changes: 1 addition & 1 deletion spec/support/shared_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

module SharedHelper
def credentials
$credentials ||= YAML.load(ERB.new(File.read "#{__dir__}/../credentials.yml").result)
$credentials ||= YAML.safe_load(ERB.new(File.read "#{__dir__}/../credentials.yml").result)
rescue Errno::ENOENT
warn "WARNING: Running w/o valid AuthorizeNet sandbox credentials. Create spec/credentials.yml."
end
Expand Down