21
21
QSpacerItem , QInputDialog , QLineEdit
22
22
23
23
from fk .core .abstract_event_source import AbstractEventSource , start_workitem
24
+ from fk .core .abstract_serializer import sanitize_user_input
24
25
from fk .core .abstract_settings import AbstractSettings
25
26
from fk .core .abstract_timer_display import AbstractTimerDisplay
26
27
from fk .core .event_source_holder import EventSourceHolder
@@ -320,7 +321,7 @@ def _void_pomodoro(self) -> None:
320
321
dlg .setLabelText ('Are you sure you want to void current pomodoro?' )
321
322
dlg .findChild (QLineEdit ).setPlaceholderText ('Reason (optional)' )
322
323
if dlg .exec_ ():
323
- reason = f': { dlg .textValue ()} ' if dlg .textValue () else ''
324
+ reason = f': { sanitize_user_input ( dlg .textValue () )} ' if dlg .textValue () else ''
324
325
self ._source_holder .get_source ().execute (AddInterruptionStrategy ,
325
326
[workitem .get_uid (), f'Pomodoro voided{ reason } ' ])
326
327
self ._source_holder .get_source ().execute (StopTimerStrategy ,
@@ -338,7 +339,7 @@ def _interruption(self) -> None:
338
339
dlg .findChild (QLineEdit ).setPlaceholderText ('What happened (optional)' )
339
340
if dlg .exec_ ():
340
341
self ._source_holder .get_source ().execute (AddInterruptionStrategy ,
341
- [workitem .get_uid (), dlg .textValue ()])
342
+ [workitem .get_uid (), sanitize_user_input ( dlg .textValue () )])
342
343
343
344
def _finish_tracking (self ) -> None :
344
345
# We don't check if there's a running workitem, as the action is only enabled while the timer is ticking
0 commit comments