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 340497 - Export to Gallery Add album crash
Export to Gallery Add album crash
Status: RESOLVED FIXED
Product: f-spot
Classification: Other
Component: General
0.1.11
Other All
: Normal critical
: ---
Assigned To: F-spot maintainers
F-spot maintainers
Depends on:
Blocks:
 
 
Reported: 2006-05-03 08:46 UTC by Sam McHardy
Modified: 2006-05-24 00:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed fix for spaces in description and title causing crash. (720 bytes, patch)
2006-05-04 00:45 UTC, Sam McHardy
none Details | Review

Description Sam McHardy 2006-05-03 08:46:02 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:
Comment 1 Sam McHardy 2006-05-04 00:43:45 UTC
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.
Comment 2 Sam McHardy 2006-05-04 00:45:07 UTC
Created attachment 64777 [details] [review]
Proposed fix for spaces in description and title causing crash.
Comment 3 Larry Ewing 2006-05-24 00:32:42 UTC
patch committed to CVS