mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 13:11:28 +00:00
@@ -296,7 +296,7 @@ class ScriptMetadata (object):
|
|||||||
self.get_string_variable(filename, "author")]
|
self.get_string_variable(filename, "author")]
|
||||||
|
|
||||||
filepath = os.path.join(self.scripts_dir, filename)
|
filepath = os.path.join(self.scripts_dir, filename)
|
||||||
with open(filepath, "r", encoding="utf-8") as f:
|
with open(filepath, "r", encoding="utf-8", errors="replace") as f:
|
||||||
for tag_name, tag_text in nsedoc_tags_iter(f):
|
for tag_name, tag_text in nsedoc_tags_iter(f):
|
||||||
if tag_name == "output" and not entry.output:
|
if tag_name == "output" and not entry.output:
|
||||||
entry.output = tag_text
|
entry.output = tag_text
|
||||||
@@ -309,7 +309,7 @@ class ScriptMetadata (object):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_file_contents(filename):
|
def get_file_contents(filename):
|
||||||
with open(filename, "r", encoding="utf-8") as f:
|
with open(filename, "r", encoding="utf-8", errors="replace") as f:
|
||||||
contents = f.read()
|
contents = f.read()
|
||||||
return contents
|
return contents
|
||||||
|
|
||||||
@@ -343,7 +343,7 @@ class ScriptMetadata (object):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_requires(filename):
|
def get_requires(filename):
|
||||||
with open(filename, "r", encoding="utf-8") as f:
|
with open(filename, "r", encoding="utf-8", errors="replace") as f:
|
||||||
requires = ScriptMetadata.get_requires_from_file(f)
|
requires = ScriptMetadata.get_requires_from_file(f)
|
||||||
return requires
|
return requires
|
||||||
|
|
||||||
@@ -359,7 +359,7 @@ class ScriptMetadata (object):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_script_args(filename):
|
def get_script_args(filename):
|
||||||
with open(filename, "r", encoding="utf-8") as f:
|
with open(filename, "r", encoding="utf-8", errors="replace") as f:
|
||||||
args = ScriptMetadata.get_script_args_from_file(f)
|
args = ScriptMetadata.get_script_args_from_file(f)
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user