Serialize service.info, handle all 3 forms of possible serialized data (marshal, yaml, and string)

git-svn-id: file:///home/svn/framework3/trunk@9679 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2010-07-06 16:20:04 +00:00
parent 0d40a69f16
commit a482f66cb9
2 changed files with 4 additions and 1 deletions

View File

@ -9,7 +9,7 @@ class ActiveRecord::Base
begin
Marshal.load(string.unpack("m")[0])
rescue ::Exception => e
YAML.load(string)
YAML.load(string) rescue string
end
end
end

View File

@ -6,7 +6,10 @@ class Service < ActiveRecord::Base
has_many :vulns, :dependent => :destroy
has_many :notes, :dependent => :destroy
belongs_to :host
serialize :info
end
end
end