mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2025-04-19 08:55:15 +00:00
Fix Cross Site Scripting Issue (#497)
* Update eos.py * ruff format * ruff format
This commit is contained in:
parent
7734c9c32f
commit
2468efe604
@ -1224,14 +1224,14 @@ class DataImportMixin:
|
|||||||
# We jump back by 1 hour
|
# We jump back by 1 hour
|
||||||
# Repeat the value(s) (reuse value index)
|
# Repeat the value(s) (reuse value index)
|
||||||
for i in range(interval_steps_per_hour):
|
for i in range(interval_steps_per_hour):
|
||||||
logger.debug(f"{i+1}: Repeat at {next_time} with index {value_index}")
|
logger.debug(f"{i + 1}: Repeat at {next_time} with index {value_index}")
|
||||||
timestamps_with_indices.append((next_time, value_index))
|
timestamps_with_indices.append((next_time, value_index))
|
||||||
next_time = next_time.add(seconds=interval.total_seconds())
|
next_time = next_time.add(seconds=interval.total_seconds())
|
||||||
else:
|
else:
|
||||||
# We jump forward by 1 hour
|
# We jump forward by 1 hour
|
||||||
# Drop the value(s)
|
# Drop the value(s)
|
||||||
logger.debug(
|
logger.debug(
|
||||||
f"{i+1}: Skip {interval_steps_per_hour} at {next_time} with index {value_index}"
|
f"{i + 1}: Skip {interval_steps_per_hour} at {next_time} with index {value_index}"
|
||||||
)
|
)
|
||||||
value_index += interval_steps_per_hour
|
value_index += interval_steps_per_hour
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
import html
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
@ -129,8 +130,8 @@ def create_error_page(
|
|||||||
return (
|
return (
|
||||||
ERROR_PAGE_TEMPLATE.replace("STATUS_CODE", status_code)
|
ERROR_PAGE_TEMPLATE.replace("STATUS_CODE", status_code)
|
||||||
.replace("ERROR_TITLE", error_title)
|
.replace("ERROR_TITLE", error_title)
|
||||||
.replace("ERROR_MESSAGE", error_message)
|
.replace("ERROR_MESSAGE", html.escape(error_message))
|
||||||
.replace("ERROR_DETAILS", error_details)
|
.replace("ERROR_DETAILS", html.escape(error_details))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user