polybar: sanitize a bit more untrusted inputs

This commit is contained in:
Vincent Bernat 2021-12-19 12:36:00 +01:00
parent eb55cf3e84
commit 2fdafc8d3a
2 changed files with 2 additions and 1 deletions

View file

@ -177,6 +177,7 @@ if __name__ == "__main__":
round(weather["daily"][0]["temp"]["max"]),
),
]
city = city.replace('%', '%%')
conditions.insert(0, f"%{{F#888}}%{{Tx}}%{{T-}} {city}%{{F-}}")
output = " ".join(conditions).replace("%{Tx}", "%%{T%d}" % options.font_index)
logger.debug("output: %s", output)