Bug 1018589 - Can't add RSS feed with Cyrillic URL -> support idn urls for feeds. r=mkmelin
This commit is contained in:
Родитель
fd510c1206
Коммит
f4387b8400
|
@ -3592,6 +3592,10 @@ let FeedMessageHandler = {
|
|||
aMimeMsg.headers["content-base"][0]) {
|
||||
let url = aMimeMsg.headers["content-base"], uri;
|
||||
try {
|
||||
let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
|
||||
.createInstance(Ci.nsIScriptableUnicodeConverter);
|
||||
converter.charset = "UTF-8";
|
||||
url = converter.ConvertToUnicode(url);
|
||||
uri = Services.io.newURI(url, null, null);
|
||||
url = uri.spec;
|
||||
}
|
||||
|
|
|
@ -251,7 +251,7 @@ Feed.prototype =
|
|||
if (url)
|
||||
url = url.QueryInterface(Ci.nsIRDFLiteral).Value;
|
||||
else
|
||||
url = this.resource.Value;
|
||||
url = this.resource.ValueUTF8;
|
||||
|
||||
return url;
|
||||
},
|
||||
|
|
|
@ -278,7 +278,7 @@ var FeedUtils = {
|
|||
while (enumerator.hasMoreElements())
|
||||
{
|
||||
let containerArc = enumerator.getNext();
|
||||
let uri = containerArc.QueryInterface(Ci.nsIRDFResource).Value;
|
||||
let uri = containerArc.QueryInterface(Ci.nsIRDFResource).ValueUTF8;
|
||||
feedUrlArray.push(uri);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -340,7 +340,7 @@ FeedParser.prototype =
|
|||
|
||||
// Prefer the value of the link tag to the item URI since the URI could be
|
||||
// a relative URN.
|
||||
let uri = itemResource.Value;
|
||||
let uri = itemResource.ValueUTF8;
|
||||
let link = this.getRDFTargetValue(ds, itemResource, FeedUtils.RSS_LINK);
|
||||
item.url = link || uri;
|
||||
item.description = this.getRDFTargetValue(ds, itemResource,
|
||||
|
|
|
@ -1398,7 +1398,7 @@ var FeedSubscriptions = {
|
|||
let currentFolderServer = itemToEdit.parentFolder.server;
|
||||
let ds = FeedUtils.getSubscriptionsDS(currentFolderServer);
|
||||
let currentFolder = ds.GetTarget(resource, FeedUtils.FZ_DESTFOLDER, true);
|
||||
let currentFolderURI = currentFolder.QueryInterface(Ci.nsIRDFResource).Value;
|
||||
let currentFolderURI = currentFolder.QueryInterface(Ci.nsIRDFResource).ValueUTF8;
|
||||
let feed = new Feed(resource, currentFolderServer);
|
||||
feed.folder = itemToEdit.parentFolder;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче