sql.rb (WhatWeb-0.5.4) | : | sql.rb (WhatWeb-0.5.5) | ||
---|---|---|---|---|
skipping to change at line 48 | skipping to change at line 48 | |||
def flatten_elements!(obj) | def flatten_elements!(obj) | |||
if obj.class == Hash | if obj.class == Hash | |||
obj.each_value { |x| flatten_elements!(x) } | obj.each_value { |x| flatten_elements!(x) } | |||
elsif obj.class == Array | elsif obj.class == Array | |||
obj.flatten! | obj.flatten! | |||
end | end | |||
end | end | |||
def escape_for_sql(s) | def escape_for_sql(s) | |||
s = s.to_s | s = s.to_s | |||
if s.nil? | "'" + s.gsub("'"){"\\'"} + "'" | |||
"''" | ||||
else | ||||
"'" + s.tr("'", "\'") + "'" | ||||
end | ||||
end | end | |||
def create_tables | def create_tables | |||
# Note that you may encounter the error "1709 - Index column size too large. The maximum column size is 767 bytes." | # Note that you may encounter the error "1709 - Index column size too large. The maximum column size is 767 bytes." | |||
# when using MySQL <= 5.6 with the innodb engine and the utf8mb4 character s et | # when using MySQL <= 5.6 with the innodb engine and the utf8mb4 character s et | |||
# | # | |||
# max_hostname_length = 253 | # max_hostname_length = 253 | |||
# max_uri_prefix = 10 # covers https:// | # max_uri_prefix = 10 # covers https:// | |||
# max_url_length = 2048 # old IE limit | # max_url_length = 2048 # old IE limit | |||
max_target_length = 2048 | max_target_length = 2048 | |||
End of changes. 1 change blocks. | ||||
5 lines changed or deleted | 1 lines changed or added |