Closed Bug 652557 Opened 13 years ago Closed 13 years ago

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

Categories

(SeaMonkey :: Feed Discovery and Preview, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
seamonkey2.1final

People

(Reporter: philip.chee, Assigned: philip.chee)

Details

Attachments

(1 file, 1 obsolete file)

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"
Attachment #528119 - Flags: review?(neil)
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...
> 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)
Attachment #528285 - Flags: review?(neil) → review+
Pushed:
http://hg.mozilla.org/comm-central/rev/c3eb66f60c2b
http://hg.mozilla.org/releases/comm-2.0/rev/f1b7464a4fd7
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.1final
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: