pidgin/win32/gtkwin32dep.c

branch
release-2.x.y
changeset 33647
c76b490587d4
parent 33371
6d93866a4a3f
child 33898
0f4b2e3ac978
child 37507
43b559f9cb68
equal deleted inserted replaced
33646:9e41dd502922 33647:c76b490587d4
169 g_free(w_clazz); 169 g_free(w_clazz);
170 170
171 } 171 }
172 172
173 void winpidgin_notify_uri(const char *uri) { 173 void winpidgin_notify_uri(const char *uri) {
174 /* We'll allow whatever URI schemes are supported by the 174 /* Allow a few commonly used and "safe" schemes to go to the specific
175 * default http browser. 175 * class handlers and send everything else to the default http browser.
176 * This isn't optimal, but should cover the most common cases. I didn't
177 * see any better secure solutions when I did some research.
176 */ 178 */
177 winpidgin_shell_execute(uri, "open", "http"); 179 gchar *scheme = g_uri_parse_scheme(uri);
180 if (scheme && (g_ascii_strcasecmp(scheme, "https") == 0
181 || g_ascii_strcasecmp(scheme, "ftp") == 0
182 || g_ascii_strcasecmp(scheme, "mailto") == 0))
183 winpidgin_shell_execute(uri, "open", scheme);
184 else
185 winpidgin_shell_execute(uri, "open", "http");
186 g_free(scheme);
178 } 187 }
179 188
180 #define PIDGIN_WM_FOCUS_REQUEST (WM_APP + 13) 189 #define PIDGIN_WM_FOCUS_REQUEST (WM_APP + 13)
181 #define PIDGIN_WM_PROTOCOL_HANDLE (WM_APP + 14) 190 #define PIDGIN_WM_PROTOCOL_HANDLE (WM_APP + 14)
182 191

mercurial