Bug 1433357 - Part 2: Suppress upload-file-dialog proxy bypass in Linux r=karlt
authorArthur Edelstein <arthuredelstein@gmail.com>
Fri, 02 Feb 2018 14:44:00 +0200
changeset 751764 bd385579481b516dbb640159e7499a6e36e41bfe
parent 751763 b5ad0c384202b82b67d25949bbf6cde061b99cbe
child 751765 a7f88998e959dd94f9050371824b1e9a379cc705
push id98047
push userbmo:continuation@gmail.com
push dateTue, 06 Feb 2018 22:02:37 +0000
reviewerskarlt
bugs1433357
milestone60.0a1
Bug 1433357 - Part 2: Suppress upload-file-dialog proxy bypass in Linux r=karlt
widget/gtk/nsFilePicker.cpp
--- a/widget/gtk/nsFilePicker.cpp
+++ b/widget/gtk/nsFilePicker.cpp
@@ -397,19 +397,24 @@ nsFilePicker::Open(nsIFilePickerShownCal
       gtk_file_chooser_dialog_new(title.get(), parent_widget, action,
                                   GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                                   accept_button, GTK_RESPONSE_ACCEPT,
                                   nullptr);
   gtk_dialog_set_alternative_button_order(GTK_DIALOG(file_chooser),
                                           GTK_RESPONSE_ACCEPT,
                                           GTK_RESPONSE_CANCEL,
                                           -1);
+
+  // If we have --enable-proxy-bypass-protection, then don't allow
+  // remote URLs to be used.
+#ifndef MOZ_PROXY_BYPASS_PROTECTION
   if (mAllowURLs) {
     gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(file_chooser), FALSE);
   }
+#endif
 
   if (action == GTK_FILE_CHOOSER_ACTION_OPEN || action == GTK_FILE_CHOOSER_ACTION_SAVE) {
     GtkWidget *img_preview = gtk_image_new();
     gtk_file_chooser_set_preview_widget(GTK_FILE_CHOOSER(file_chooser), img_preview);
     g_signal_connect(file_chooser, "update-preview", G_CALLBACK(UpdateFilePreviewWidget), img_preview);
   }
 
   GtkWindow *window = GTK_WINDOW(file_chooser);