mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-29 22:16:13 +02:00
Change all instances of FullLoader to SafeLoader (#1285)
This commit is contained in:
parent
26484130c3
commit
9e3153453e
3 changed files with 7 additions and 7 deletions
|
@ -41,7 +41,7 @@ def make_yaml_valid_dict(input: list) -> dict:
|
|||
|
||||
# yaml compatible strings are of the form Key:Value
|
||||
yamlstr = YAML_SEPARATOR.join(input)
|
||||
runtime_modifications = yaml.load(yamlstr, Loader=yaml.FullLoader)
|
||||
runtime_modifications = yaml.load(yamlstr, Loader=yaml.SafeLoader)
|
||||
|
||||
return runtime_modifications
|
||||
|
||||
|
@ -140,7 +140,7 @@ def verify_config_colors(config):
|
|||
def load_config(config_path):
|
||||
"""Tries to load a config file from YAML."""
|
||||
with open(config_path) as f:
|
||||
return yaml.load(f, Loader=yaml.FullLoader)
|
||||
return yaml.load(f, Loader=yaml.SafeLoader)
|
||||
|
||||
|
||||
def is_config_json(config_path):
|
||||
|
|
|
@ -26,7 +26,7 @@ class Template:
|
|||
def from_file(cls, filename):
|
||||
with open(filename) as f:
|
||||
front_matter, body = f.read().strip("-\n").split("---", 2)
|
||||
front_matter = yaml.load(front_matter, Loader=yaml.FullLoader)
|
||||
front_matter = yaml.load(front_matter, Loader=yaml.SafeLoader)
|
||||
template = cls(body)
|
||||
template.__dict__.update(front_matter)
|
||||
return template
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue