This fixes a crash bug when opening the options dialog.
-
Check the return value of split() to avoid segmentation faults due to out of bounds when the user manages to enter invalid proxy settings. This is reported resonably often.
-
Move the default proxy/port to a constant instead of hardcoding magic values.
-
Factor out some common code.
-
Revert #11448 because this proves a more robust replacement, it is no longer necessary and didn’t generally solve the issue.
No attempt is made to do full sanity checking on the proxy, so it can still be rejected by the core with an InitError message.