diff options
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/inputwidget.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c index b94e0c27..24983d69 100644 --- a/src/ui/inputwidget.c +++ b/src/ui/inputwidget.c | |||
@@ -1100,9 +1100,15 @@ static void updateBuffered_InputWidget_(iInputWidget *d) { | |||
1100 | void setText_InputWidget(iInputWidget *d, const iString *text) { | 1100 | void setText_InputWidget(iInputWidget *d, const iString *text) { |
1101 | if (!d) return; | 1101 | if (!d) return; |
1102 | if (d->inFlags & isUrl_InputWidgetFlag) { | 1102 | if (d->inFlags & isUrl_InputWidgetFlag) { |
1103 | /* If user wants URLs encoded, also Punycode the domain. */ | 1103 | if (prefs_App()->decodeUserVisibleURLs) { |
1104 | if (!prefs_App()->decodeUserVisibleURLs) { | ||
1105 | iString *enc = collect_String(copy_String(text)); | 1104 | iString *enc = collect_String(copy_String(text)); |
1105 | urlDecodePath_String(enc); | ||
1106 | text = enc; | ||
1107 | } | ||
1108 | else { | ||
1109 | /* The user wants URLs encoded, also Punycode the domain. */ | ||
1110 | iString *enc = collect_String(copy_String(text)); | ||
1111 | urlEncodePath_String(enc); | ||
1106 | /* Prevent address bar spoofing (mentioned as IDN homograph attack in | 1112 | /* Prevent address bar spoofing (mentioned as IDN homograph attack in |
1107 | https://github.com/skyjake/lagrange/issues/73) */ | 1113 | https://github.com/skyjake/lagrange/issues/73) */ |
1108 | punyEncodeUrlHost_String(enc); | 1114 | punyEncodeUrlHost_String(enc); |