Skip to content

Commit f657d0c

Browse files
Bug 18101: Suppress upload file dialog proxy bypass (linux)
1 parent 1eeaa47 commit f657d0c

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

widget/gtk/nsFilePicker.cpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ NS_IMPL_ISUPPORTS(nsFilePicker, nsIFilePicker)
170170
nsFilePicker::nsFilePicker()
171171
: mSelectedType(0)
172172
, mRunning(false)
173-
, mAllowURLs(false)
174173
#if (MOZ_WIDGET_GTK == 3)
175174
, mFileChooserDelegate(nullptr)
176175
#endif
@@ -239,13 +238,6 @@ nsFilePicker::InitNative(nsIWidget *aParent,
239238
mTitle.Assign(aTitle);
240239
}
241240

242-
NS_IMETHODIMP
243-
nsFilePicker::AppendFilters(int32_t aFilterMask)
244-
{
245-
mAllowURLs = !!(aFilterMask & filterAllowURLs);
246-
return nsBaseFilePicker::AppendFilters(aFilterMask);
247-
}
248-
249241
NS_IMETHODIMP
250242
nsFilePicker::AppendFilter(const nsAString& aTitle, const nsAString& aFilter)
251243
{
@@ -402,9 +394,9 @@ nsFilePicker::Open(nsIFilePickerShownCallback *aCallback)
402394
GTK_RESPONSE_ACCEPT,
403395
GTK_RESPONSE_CANCEL,
404396
-1);
405-
if (mAllowURLs) {
406-
gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(file_chooser), FALSE);
407-
}
397+
398+
// Don't allow remote URLs.
399+
gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(file_chooser), TRUE);
408400

409401
if (action == GTK_FILE_CHOOSER_ACTION_OPEN || action == GTK_FILE_CHOOSER_ACTION_SAVE) {
410402
GtkWidget *img_preview = gtk_image_new();

widget/gtk/nsFilePicker.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ class nsFilePicker : public nsBaseFilePicker
2525

2626
// nsIFilePicker (less what's in nsBaseFilePicker)
2727
NS_IMETHOD Open(nsIFilePickerShownCallback *aCallback) override;
28-
NS_IMETHOD AppendFilters(int32_t aFilterMask) override;
2928
NS_IMETHOD AppendFilter(const nsAString& aTitle,
3029
const nsAString& aFilter) override;
3130
NS_IMETHOD SetDefaultString(const nsAString& aString) override;
@@ -62,7 +61,6 @@ class nsFilePicker : public nsBaseFilePicker
6261
int16_t mSelectedType;
6362
int16_t mResult;
6463
bool mRunning;
65-
bool mAllowURLs;
6664
nsCString mFileURL;
6765
nsString mTitle;
6866
nsString mDefault;

0 commit comments

Comments
 (0)