[Pkg-mozext-commits] [sage-extension] 43/49: [15772] ensure clean feed and feeditem link URLs

David Prévot taffit at moszumanska.debian.org
Fri May 1 03:10:56 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to tag sage_1_3_10
in repository sage-extension.

commit 9d2b67edd6b19891c5bb41014012e41781779bc5
Author: Peter Andrews <petea at jhu.edu>
Date:   Fri Nov 17 19:49:47 2006 +0000

    [15772] ensure clean feed and feeditem link URLs
---
 src/sage/content/feedlib.js | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/src/sage/content/feedlib.js b/src/sage/content/feedlib.js
index e905422..1041715 100644
--- a/src/sage/content/feedlib.js
+++ b/src/sage/content/feedlib.js
@@ -315,7 +315,19 @@ Feed.prototype.getDescription = function() {
 }
 
 Feed.prototype.getLink = function() {
-	return this.link;
+	const URIFixup = Components.classes["@mozilla.org/docshell/urifixup;1"].getService(Components.interfaces.nsIURIFixup);
+	var urlString;
+	try {
+		var uri = URIFixup.createFixupURI(this.link, URIFixup.FIXUP_FLAG_NONE);
+		if (uri.scheme != "javascript") {
+			urlString = uri.spec;
+		} else {
+			urlString = "";
+		}
+	} catch (e) {
+		urlString = "";
+	}
+	return urlString;
 }
 
 Feed.prototype.hasLastPubDate = function() {
@@ -424,7 +436,19 @@ FeedItem.prototype.getTitle = function() {
 }
 
 FeedItem.prototype.getLink = function() {
-	return this.link;
+	const URIFixup = Components.classes["@mozilla.org/docshell/urifixup;1"].getService(Components.interfaces.nsIURIFixup);
+	var urlString;
+	try {
+		var uri = URIFixup.createFixupURI(this.link, URIFixup.FIXUP_FLAG_NONE);
+		if (uri.scheme != "javascript") {
+			urlString = uri.spec;
+		} else {
+			urlString = "";
+		}
+	} catch (e) {
+		urlString = "";
+	}
+	return urlString;
 }
 
 FeedItem.prototype.hasContent = function() {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/sage-extension.git



More information about the Pkg-mozext-commits mailing list