After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 683711 - Epiphany should sanitize suggested filenames returned by the server
Epiphany should sanitize suggested filenames returned by the server
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Backend
3.5.x
Other Linux
: Normal normal
: ---
Assigned To: Xan Lopez
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-09-10 11:26 UTC by Carlos Garcia Campos
Modified: 2012-09-10 15:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ephy-file-helpers: Add ephy_sanitize_filename() (2.26 KB, patch)
2012-09-10 11:26 UTC, Carlos Garcia Campos
committed Details | Review
Patch (1.52 KB, patch)
2012-09-10 11:27 UTC, Carlos Garcia Campos
committed Details | Review

Description Carlos Garcia Campos 2012-09-10 11:26:04 UTC
Ephy uses the filename suggested by the server for downloads and saving. The server might return a filename that contains directory separators. The download will fail because the filename is considered a full path.
Comment 1 Carlos Garcia Campos 2012-09-10 11:26:53 UTC
Created attachment 223896 [details] [review]
ephy-file-helpers: Add ephy_sanitize_filename()
Comment 2 Carlos Garcia Campos 2012-09-10 11:27:15 UTC
Created attachment 223897 [details] [review]
Patch
Comment 3 Xan Lopez 2012-09-10 13:41:52 UTC
Review of attachment 223896 [details] [review]:

A simple test for this would be awesome, fwiw.

::: lib/ephy-file-helpers.c
@@ +1061,3 @@
+ * filesystem.
+ *
+ * Note that it todifies string in place, and returns string itself,

s/todifies/modifies/, you can get rid of the "and returns string itself" bit, it is redundant.
Comment 4 Xan Lopez 2012-09-10 13:42:22 UTC
Review of attachment 223897 [details] [review]:

OK.