mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-08 06:00:51 -07:00
Better sanitization on templates and datatables output.
This commit is contained in:
parent
1157fda96c
commit
b0fa0d534e
7 changed files with 206 additions and 196 deletions
|
@ -155,7 +155,7 @@ def human_duration(s):
|
|||
h = int((s % 84600) / 3600)
|
||||
m = int(((s % 84600) % 3600) / 60)
|
||||
s = int(((s % 84600) % 3600) % 60)
|
||||
|
||||
|
||||
hd_list = []
|
||||
if d > 0:
|
||||
hd_list.append(str(d) + ' days')
|
||||
|
@ -165,7 +165,7 @@ def human_duration(s):
|
|||
hd_list.append(str(m) + ' mins')
|
||||
if s > 0:
|
||||
hd_list.append(str(s) + ' secs')
|
||||
|
||||
|
||||
hd = ' '.join(hd_list)
|
||||
|
||||
return hd
|
||||
|
@ -204,7 +204,7 @@ def piratesize(size):
|
|||
split = size.split(" ")
|
||||
factor = float(split[0])
|
||||
unit = split[1].upper()
|
||||
|
||||
|
||||
if unit == 'MiB':
|
||||
size = factor * 1048576
|
||||
elif unit == 'MB':
|
||||
|
@ -433,6 +433,6 @@ def process_json_kwargs(json_kwargs):
|
|||
|
||||
def sanitize(string):
|
||||
if string:
|
||||
return str(string).replace('<','<').replace('>','>')
|
||||
return unicode(string).replace('<','<').replace('>','>')
|
||||
else:
|
||||
return ''
|
||||
return ''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue