module Zendesk::CsvScrubber

Public Class Methods

macro_string?(value) click to toggle source
# File lib/csv_scrubber.rb, line 10
def self.macro_string?(value)
  value.is_a?(String) && value.size > 1 && value.start_with?("=", "+", "-", "@")
end
scrub_output(value) click to toggle source
# File lib/csv_scrubber.rb, line 3
def self.scrub_output(value)
  # escape macro operators at the beginning of strings to
  # prevent malicious macro injection, e.g. (=, +, -, @)
  value = "'#{value}" if macro_string?(value)
  value
end