diff options
Diffstat (limited to 'src/ui/inputwidget.c')
-rw-r--r-- | src/ui/inputwidget.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c index 6992bbec..62f0341e 100644 --- a/src/ui/inputwidget.c +++ b/src/ui/inputwidget.c | |||
@@ -224,6 +224,16 @@ static void updateBuffered_InputWidget_(iInputWidget *d) { | |||
224 | } | 224 | } |
225 | 225 | ||
226 | void setText_InputWidget(iInputWidget *d, const iString *text) { | 226 | void setText_InputWidget(iInputWidget *d, const iString *text) { |
227 | if (d->inFlags & isUrl_InputWidgetFlag) { | ||
228 | /* If user wants URLs encoded, also Punycode the domain. */ | ||
229 | if (!prefs_App()->decodeUserVisibleURLs) { | ||
230 | iString *enc = collect_String(copy_String(text)); | ||
231 | /* Prevent address bar spoofing (mentioned as IDN homograph attack in | ||
232 | https://github.com/skyjake/lagrange/issues/73) */ | ||
233 | punyEncodeUrlHost_String(enc); | ||
234 | text = enc; | ||
235 | } | ||
236 | } | ||
227 | clearUndo_InputWidget_(d); | 237 | clearUndo_InputWidget_(d); |
228 | clear_Array(&d->text); | 238 | clear_Array(&d->text); |
229 | iConstForEach(String, i, text) { | 239 | iConstForEach(String, i, text) { |