bugzilla-daemon at freedesktop.org
2008-Jul-15 03:37 UTC
[Swfdec] [Bug 16716] New: swfdec doesn't handle uri encoding, leading to failures on file:///
http://bugs.freedesktop.org/show_bug.cgi?id=16716 Summary: swfdec doesn't handle uri encoding, leading to failures on file:/// Product: swfdec Version: unspecified Platform: Other OS/Version: All Status: NEW Severity: major Priority: medium Component: library AssignedTo: swfdec at lists.freedesktop.org ReportedBy: tetromino at gmail.com QAContact: swfdec at lists.freedesktop.org The symptoms: in Nautilus, double-click on a flash file that has spaces, question marks, or non-ASCII characters in its name (e.g. "??????.swf"). Swfdec-player says that "%D0%B8%D0%B1%D1%80%D0%B0%D0%B6%D1%8B.swf is not a Flash file." The reason this is happening is that SwfdecURL is blithely ignorant of URI encoding. See http://www.w3.org/Addressing/URL/4_URI_Recommentations.html for a short introduction to the subject. So when Nautilus calls 'swfdec-player file:///home/me/%D0%B8%D0%B1%D1%80%D0%B0%D0%B6%D1%8B.swf', and the URL gets passed to swfdec_url_new(), the resulting SwfdecURL ends up with "/home/me/%D0%B8%D0%B1%D1%80%D0%B0%D0%B6%D1%8B.swf" in its path field, which obviously doesn't exist on my hard drive, leading to failure. There are two ways of fixing this situation. The WRONG way would be to make swfdec-player pass invalid URIs ("file:///home/me/??????.swf") to work around swfdec_url's broken behavior. The right way is to formally specify, for EACH string parameter and return value of swfdec_url_* functions, whether the parameter is "raw" or URI-encoded, and to put in code to do the appropriate conversions. This needs to be thought out carefully so as not to break existing uses too much. -- Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. You are the assignee for the bug.
bugzilla-daemon at freedesktop.org
2008-Jul-15 06:58 UTC
[Swfdec] [Bug 16716] swfdec doesn't handle uri encoding, leading to failures on file :///
http://bugs.freedesktop.org/show_bug.cgi?id=16716 --- Comment #1 from Benjamin Otte <otte at gnome.org> 2008-07-14 23:58:58 PST --- Created an attachment (id=17679) --> (http://bugs.freedesktop.org/attachment.cgi?id=17679) file displaying the current URL Looks like we'll want implement this as close to the WRONG way as possible. The reason for this is that SwfdecURL is meant to do what the Flash player does when handling urls. And the Flash player happily puts all the characters into the URL as they are ignoring (as usual) any standards out there. But we definitely want to have something like swfdec_url_(from|to)_real_url() and make swfdec_url_from_input() use this. -- Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. You are the assignee for the bug.
bugzilla-daemon at freedesktop.org
2008-Jul-15 09:04 UTC
[Swfdec] [Bug 16716] swfdec doesn't handle uri encoding, leading to failures on file :///
http://bugs.freedesktop.org/show_bug.cgi?id=16716 --- Comment #2 from Alex Rostovtsev <tetromino at gmail.com> 2008-07-15 02:04:02 PST --- (In reply to comment #1)> Created an attachment (id=17679)--> (http://bugs.freedesktop.org/attachment.cgi?id=17679) [details]> The reason for this is that SwfdecURL is meant to do what the Flash player does > when handling urls. And the Flash player happily puts all the characters into > the URL as they are ignoring (as usual) any standards out there.I don't think you understood the problem. The issue is not with how flash files are interpreted (so Adobe's plugin's behavior is not relevant to the discussion). The issue is with swfdec's API. - The swfdec API includes functions with a parameter that can be interpreted both as a url (or part of a url) and as a pathname on disk (or part of a pathname). - Which happily ignores the fact that urls are in URI encoding while local pathnames are in UTF-8. And there are no flags to specify which encoding the parameter is in. - When local pathnames with non-ASCII characters are involved, the API provides no way to construct a SwfdecURL object whose url and path fields are both valid and consistent with each other. - The SwfdecURL object is used, among other things, to specify where to load the flash files from. - Outside the browser, Swfdec relies on its own loader classes to do IO. Those loaders assume that the fields of the SwfdecURL object are valid and consistent. -- Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. You are the assignee for the bug.
bugzilla-daemon at freedesktop.org
2008-Jul-15 10:15 UTC
[Swfdec] [Bug 16716] swfdec doesn't handle uri encoding, leading to failures on file :///
http://bugs.freedesktop.org/show_bug.cgi?id=16716 --- Comment #3 from Alex Rostovtsev <tetromino at gmail.com> 2008-07-15 03:15:40 PST --- (In reply to comment #1)> Created an attachment (id=17679)--> (http://bugs.freedesktop.org/attachment.cgi?id=17679) [details]> file displaying the current URLInteresting. Swfdec-mozilla shows a valid URL (file:///home/me/%D0%B8%D0%B1%D1%80%D0%B0%D0%B6%D1%8B.swf). Meanwhile, both swfdec-player and Adobe's plugin show an invalid URL (file:///home/rostovts/??????.swf). Now, Firefox certainly calls Adobe's plugin with a valid URL. My guess is that Adobe's plugin is printing the display form (.toString() or something) of the URL object instead of the actual URL string... -- Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. You are the assignee for the bug.
bugzilla-daemon at freedesktop.org
2008-Jul-15 19:04 UTC
[Swfdec] [Bug 16716] swfdec doesn't handle uri encoding, leading to failures on file :///
http://bugs.freedesktop.org/show_bug.cgi?id=16716 --- Comment #4 from Alex Rostovtsev <tetromino at gmail.com> 2008-07-15 12:04:58 PST --- Created an attachment (id=17683) --> (http://bugs.freedesktop.org/attachment.cgi?id=17683) swf file that tests whether encoded URLs work As can be seen from this test file, Adobe's plugin expects URLs to be in valid URI encoding; if the URL is raw UTF-8, it won't load. (Note that this example does not work on swfdec-0.6.6 for some reason) --------- .flash filename="urltest.swf" bbox=400x100 version=7 background="#dddddd" .action: var url1 = "%D0%B8%D0%B1%D1%80%D0%B0%D0%B6%D1%8B.swf"; var url2 = "??????.swf"; createTextField("t0", 0, 0, 0, 400, 20); t0.text = "Try click on the relative URLs below"; createTextField("t1", 1, 0, 30, 400, 20); createTextField("t2", 2, 0, 60, 400, 20); var f1 = new TextFormat(); f1.url = url1; t1.text = "Encoded URL works: " + url1; t1.html = true; t1.setTextFormat(f1); var f2 = new TextFormat(); f2.url = url2; t2.text = "UTF-8 URL does not load: " + url2; t2.html = true; t2.setTextFormat(f2); .end .end -- Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. You are the assignee for the bug.
bugzilla-daemon at freedesktop.org
2008-Jul-16 03:44 UTC
[Swfdec] [Bug 16716] swfdec doesn't handle uri encoding, leading to failures on file :///
http://bugs.freedesktop.org/show_bug.cgi?id=16716 --- Comment #5 from Alex Rostovtsev <tetromino at gmail.com> 2008-07-15 20:44:38 PST --- Created an attachment (id=17694) --> (http://bugs.freedesktop.org/attachment.cgi?id=17694) swfdec-0.6.6-uri-encoding.patch Patch to fix the problem. What it does: 1. Documents what fields, parameters and return values are supposed to be in filesystem encoding (the parameter to swfdec_url_new_from_input(), so long as it doesn't look like a URL), and which ones are URI-encoded (everything else). 2. Adds URI-encoding logic to swfdec_url_new_from_input() 3. Adds a function for converting URI-encoded strings to UTF-8 4. Adds URI-decoding logic to swfdec_url_format_for_display() 5. Adds URI-decoding logic to SwfdecFileLoader. With this patch, swfdec-player correctly opens weirdly-named swf files both from Nautilus, from command line, and from its own file dialog. And even the window title is correct! The patch is for swfdec-0.6.6, but it seems to also apply OK to 0.7.2. -- Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. You are the assignee for the bug.
bugzilla-daemon at freedesktop.org
2008-Jul-17 19:38 UTC
[Swfdec] [Bug 16716] swfdec doesn't handle uri encoding, leading to failures on file :///
http://bugs.freedesktop.org/show_bug.cgi?id=16716 Benjamin Otte <otte at gnome.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #6 from Benjamin Otte <otte at gnome.org> 2008-07-17 12:38:06 PST --- Fixed in git. -- Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. You are the assignee for the bug.