aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Jacq <mig@mig5.net>2024-02-16 15:00:12 +1100
committerMiguel Jacq <mig@mig5.net>2024-02-16 15:00:12 +1100
commitaae0f8f045eafcc88d70b23cdc1e7e38c39fae23 (patch)
treece7b8ca912a85c4e98ddb803088a53a282294eb5
parentad69fa55db0ff8b2a4670561cf19615a4c05da9d (diff)
downloadonionshare-aae0f8f045eafcc88d70b23cdc1e7e38c39fae23.tar.gz
onionshare-aae0f8f045eafcc88d70b23cdc1e7e38c39fae23.zip
Remove newlines from History item paths
-rw-r--r--desktop/onionshare/tab/mode/history.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/desktop/onionshare/tab/mode/history.py b/desktop/onionshare/tab/mode/history.py
index 3afdfc15..ad8af099 100644
--- a/desktop/onionshare/tab/mode/history.py
+++ b/desktop/onionshare/tab/mode/history.py
@@ -23,6 +23,7 @@ import subprocess
import os
from datetime import datetime
from PySide6 import QtCore, QtWidgets, QtGui
+from urllib.parse import unquote
from ... import strings
from ...widgets import Alert
@@ -464,7 +465,9 @@ class IndividualFileHistoryItem(HistoryItem):
self.common = common
self.id = id
- self.path = path
+ # Decode and sanitize the path to remove newlines
+ decoded_path = unquote(path)
+ self.path = decoded_path.replace("\r", "").replace("\n", "")
self.total_bytes = 0
self.downloaded_bytes = 0
self.started = time.time()