end
def is_valid_subscription?(content)
- content.length != 0 && YAML.load(content)
+ return false if content.length == 0
+ return false unless content.start_with?("---\n")
+ begin
+ YAML.load(content)
+ true
+ rescue ArgumentError
+ # Parse error
+ false
+ end
end
def is_valid_subscription_file?(file)