If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Media file display names should use decodeURIComponent instead of decodeURI (Port Bug 494328)

RESOLVED FIXED in seamonkey2.1final

Status

SeaMonkey
Feed Discovery and Preview
--
enhancement
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: Philip Chee, Assigned: Philip Chee)

Tracking

Trunk
seamonkey2.1final

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

7 years ago
From Bug 494328 Comment 0:

> Just nitpicking really, since we're only displaying the filename of the media
> file, there are no special characters to watch out for.
> 
> Reproducible: Always
> 
> Steps to Reproduce:
> Open a podcast feed with files named like "Episode #4", this will be encoded in
> the XML as "Episode%20%234"
> Actual Results:  
> Will display as "Episode %234"
> 
> Expected Results:  
> Should display as "Episode #4"
(Assignee)

Comment 1

7 years ago
Created attachment 528119 [details] [diff] [review]
Patch v1.0 use decodeURIComponent()
Attachment #528119 - Flags: review?(neil)

Comment 2

7 years ago
Comment on attachment 528119 [details] [diff] [review]
Patch v1.0 use decodeURIComponent()

Review of attachment 528119 [details] [diff] [review]:

::: suite/feeds/src/FeedWriter.js
@@ +557,5 @@
     var url = makeURI(aURL);
 
     if ((url instanceof Components.interfaces.nsIURL) && url.fileName)
+      return decodeURIComponent(url.fileName);
+    return decodeURIComponent(aURL);

I can see that it's right to decodeURIComponent on the fileName component, but I'm not wholly convinced that we should do it on the URL itself...
(Assignee)

Comment 3

7 years ago
Created attachment 528285 [details] [diff] [review]
Patch v1.1 fixup the url.fileName only

> Review of attachment 528119 [details] [diff] [review]:
> 
> ::: suite/feeds/src/FeedWriter.js
> @@ +557,5 @@
>      var url = makeURI(aURL);
> 
>      if ((url instanceof Components.interfaces.nsIURL) && url.fileName)
> +      return decodeURIComponent(url.fileName);
> +    return decodeURIComponent(aURL);
> 
> I can see that it's right to decodeURIComponent on the fileName component, but
> I'm not wholly convinced that we should do it on the URL itself...
Yes. I wondered why Firefox bothered doing this as well.
Fixed.
Attachment #528119 - Attachment is obsolete: true
Attachment #528119 - Flags: review?(neil)
Attachment #528285 - Flags: review?(neil)

Updated

7 years ago
Attachment #528285 - Flags: review?(neil) → review+
(Assignee)

Comment 4

7 years ago
Pushed:
http://hg.mozilla.org/comm-central/rev/c3eb66f60c2b
http://hg.mozilla.org/releases/comm-2.0/rev/f1b7464a4fd7
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.1final
You need to log in before you can comment on or make changes to this bug.