[tbb-commits] [tor-browser/tor-browser-52.3.0esr-7.5-2] Bug 18101: Suppress upload file dialog proxy bypass (linux)

gk at torproject.org gk at torproject.org
Thu Sep 21 16:02:05 UTC 2017


commit eb7cb8fe69de4ca08b8aa2ece0faeb7ea6217004
Author: Arthur Edelstein <arthuredelstein at gmail.com>
Date:   Wed Sep 20 09:35:38 2017 -0700

    Bug 18101: Suppress upload file dialog proxy bypass (linux)
---
 widget/gtk/nsFilePicker.cpp | 14 +++-----------
 widget/gtk/nsFilePicker.h   |  2 --
 2 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp
index 172cb4444849..d1ab963e1012 100644
--- a/widget/gtk/nsFilePicker.cpp
+++ b/widget/gtk/nsFilePicker.cpp
@@ -170,7 +170,6 @@ NS_IMPL_ISUPPORTS(nsFilePicker, nsIFilePicker)
 nsFilePicker::nsFilePicker()
   : mSelectedType(0)
   , mRunning(false)
-  , mAllowURLs(false)
 #if (MOZ_WIDGET_GTK == 3)
   , mFileChooserDelegate(nullptr)
 #endif
@@ -240,13 +239,6 @@ nsFilePicker::InitNative(nsIWidget *aParent,
 }
 
 NS_IMETHODIMP
-nsFilePicker::AppendFilters(int32_t aFilterMask)
-{
-  mAllowURLs = !!(aFilterMask & filterAllowURLs);
-  return nsBaseFilePicker::AppendFilters(aFilterMask);
-}
-
-NS_IMETHODIMP
 nsFilePicker::AppendFilter(const nsAString& aTitle, const nsAString& aFilter)
 {
   if (aFilter.EqualsLiteral("..apps")) {
@@ -402,9 +394,9 @@ nsFilePicker::Open(nsIFilePickerShownCallback *aCallback)
                                           GTK_RESPONSE_ACCEPT,
                                           GTK_RESPONSE_CANCEL,
                                           -1);
-  if (mAllowURLs) {
-    gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(file_chooser), FALSE);
-  }
+
+  // Don't allow remote URLs.
+  gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(file_chooser), TRUE);
 
   if (action == GTK_FILE_CHOOSER_ACTION_OPEN || action == GTK_FILE_CHOOSER_ACTION_SAVE) {
     GtkWidget *img_preview = gtk_image_new();
diff --git a/widget/gtk/nsFilePicker.h b/widget/gtk/nsFilePicker.h
index 2b5042098c65..f7b1bf639bdd 100644
--- a/widget/gtk/nsFilePicker.h
+++ b/widget/gtk/nsFilePicker.h
@@ -25,7 +25,6 @@ public:
 
   // nsIFilePicker (less what's in nsBaseFilePicker)
   NS_IMETHOD Open(nsIFilePickerShownCallback *aCallback) override;
-  NS_IMETHOD AppendFilters(int32_t aFilterMask) override;
   NS_IMETHOD AppendFilter(const nsAString& aTitle,
                           const nsAString& aFilter) override;
   NS_IMETHOD SetDefaultString(const nsAString& aString) override;
@@ -62,7 +61,6 @@ protected:
   int16_t   mSelectedType;
   int16_t   mResult;
   bool      mRunning;
-  bool      mAllowURLs;
   nsCString mFileURL;
   nsString  mTitle;
   nsString  mDefault;



More information about the tbb-commits mailing list