GNOME Bugzilla – Bug 340497
Export to Gallery Add album crash
Last modified: 2006-05-24 00:32:42 UTC
Steps to reproduce: 1. Select File/Export > Export to Web Gallery... 2. Click Add to add an album 3. Input a string with spaces in either description or title E.g (no quotes) " text" "text " "text1 text2" 4. Click Add The application will then crash. Checking the database shows that the album has not been entered and the program throws an exception when it can't find the new album it attempted to create. Stack trace: An unhandled exception was thrown: Error: Unable to parse server response in <0x0018d> GalleryRemote.Gallery:ParseBasic (System.Net.HttpWebResponse response) in <0x0000d> GalleryRemote.Gallery:ParseNewAlbum (System.Net.HttpWebResponse response) in <0x000c4> GalleryRemote.Gallery2:NewAlbum (System.String parent_name, System.String name, System.String title, System.String description) in <0x0002f> FSpot.GalleryAddAlbum:HandleAddResponse (System.Object sender, Gtk.ResponseArgs args) in (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_object_ResponseArgs (object,Gtk.ResponseArgs) in <0x00100> Gtk.Dialog:ResponseSignalCallback (IntPtr arg0, Int32 arg1, IntPtr gch) in (wrapper native-to-managed) Gtk.Dialog:ResponseSignalCallback (intptr,int,intptr) in <0x00000> <unknown method> in (wrapper managed-to-native) Gtk.Application:gtk_main () in <0x00007> Gtk.Application:Run () in <0x00007> Gnome.Program:Run () in <0x00542> FSpot.Driver:Main (System.String[] args) .NET Version: 1.1.4322.2032 Assembly Version Information: System.Xml (1.0.5000.0) FlickrNet (1.1.0.0) System.Web (1.0.5000.0) gconf-sharp (2.8.0.0) pango-sharp (2.8.0.0) SemWeb (0.5.0.2) glade-sharp (2.8.0.0) gtkhtml-sharp (2.8.0.0) System.Data (1.0.5000.0) Mono.Data.SqliteClient (1.0.5000.0) gdk-sharp (2.8.0.0) Mono.Posix (1.0.5000.0) gnome-vfs-sharp (2.8.0.0) dbus-sharp (0.60.0.0) System (1.0.5000.0) atk-sharp (2.8.0.0) gtk-sharp (2.8.0.0) glib-sharp (2.8.0.0) gnome-sharp (2.8.0.0) f-spot (0.0.0.0) mscorlib (1.0.5000.0) Platform Information: Linux 2.6.15-21-386 i686 unknown GNU/Linux Disribution Information: [/etc/debian_version] testing/unstable [/etc/lsb-release] DISTRIB_ID=Ubuntu DISTRIB_RELEASE=6.06 DISTRIB_CODENAME=dapper DISTRIB_DESCRIPTION="Ubuntu (The Dapper Drake Release) Development Branch" Other information:
After a bit of digging around I found this resource http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1 "application/x-www-form-urlencoded This is the default content type. Forms submitted with this content type must be encoded as follows: 1. Control names and values are escaped. Space characters are replaced by `+', and then reserved characters are escaped as described in [RFC1738], section 2.2: Non-alphanumeric characters are replaced by `%HH', a percent sign and two hexadecimal digits representing the ASCII code of the character. Line breaks are represented as "CR LF" pairs (i.e., `%0D%0A'). 2. The control names/values are listed in the order they appear in the document. The name is separated from the value by `=' and name/value pairs are separated from each other by `&'." I have attached a patch that replaces spaces with + and then UrlEncodes parameters before adding the & and = delimeters. This fixes the problem I had with description and title values including spaces.
Created attachment 64777 [details] [review] Proposed fix for spaces in description and title causing crash.
patch committed to CVS