From 1438d6450ff5995261705fc8e1181ed65bca027a Mon Sep 17 00:00:00 2001 From: Geoff Lankow Date: Sat, 24 Jul 2010 11:06:10 +0200 Subject: [PATCH] Bug 494328 - Media file display names should use decodeURIComponent instead of decodeURI. r=sayrer --- browser/components/feeds/src/FeedWriter.js | 4 +- browser/components/feeds/test/Makefile.in | 2 + .../components/feeds/test/bug494328-data.xml | 24 ++++++++++++ .../components/feeds/test/test_bug494328.html | 38 +++++++++++++++++++ 4 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 browser/components/feeds/test/bug494328-data.xml create mode 100644 browser/components/feeds/test/test_bug494328.html diff --git a/browser/components/feeds/src/FeedWriter.js b/browser/components/feeds/src/FeedWriter.js index 475213457db..a3b3bb023b4 100644 --- a/browser/components/feeds/src/FeedWriter.js +++ b/browser/components/feeds/src/FeedWriter.js @@ -554,9 +554,9 @@ FeedWriter.prototype = { var url = makeURI(aURL); url.QueryInterface(Ci.nsIURL); if (url == null || url.fileName.length == 0) - return aURL; + return decodeURIComponent(aURL); - return decodeURI(url.fileName); + return decodeURIComponent(url.fileName); }, /** diff --git a/browser/components/feeds/test/Makefile.in b/browser/components/feeds/test/Makefile.in index 36265d91dab..389c04f503a 100644 --- a/browser/components/feeds/test/Makefile.in +++ b/browser/components/feeds/test/Makefile.in @@ -55,6 +55,8 @@ _TEST_FILES = test_bug408328.html \ bug408328-data.xml \ test_bug368464.html \ bug368464-data.xml \ + test_bug494328.html \ + bug494328-data.xml \ test_registerHandler.html \ $(NULL) diff --git a/browser/components/feeds/test/bug494328-data.xml b/browser/components/feeds/test/bug494328-data.xml new file mode 100644 index 00000000000..58342bafc68 --- /dev/null +++ b/browser/components/feeds/test/bug494328-data.xml @@ -0,0 +1,24 @@ + + + + Channel title + Channel description + Channel link + + Episode 1 + + + + Episode 2 + + + + Episode 3 + + + + Episode 4 + + + + diff --git a/browser/components/feeds/test/test_bug494328.html b/browser/components/feeds/test/test_bug494328.html new file mode 100644 index 00000000000..f3ba2347189 --- /dev/null +++ b/browser/components/feeds/test/test_bug494328.html @@ -0,0 +1,38 @@ + + + + + Test for bug 494328 + + + + + +Mozilla Bug 494328 +

+ +
+
+
+ + +