aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWojciech Polak <polak@gnu.org>2011-10-08 10:52:07 +0200
committerWojciech Polak <polak@gnu.org>2011-10-08 10:52:07 +0200
commitda57070b7ed9cee48166d3b30dbc3baba793ed06 (patch)
tree7a6585f60cbf8b1b61b98e352de15180a3200efb
parent1598b0c775b62872bb504dbce557db2003ada826 (diff)
downloadcheetah-da57070b7ed9cee48166d3b30dbc3baba793ed06.tar.gz
cheetah-da57070b7ed9cee48166d3b30dbc3baba793ed06.tar.bz2
Add protocol-relative links support.
-rw-r--r--js/v2/core.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/js/v2/core.js b/js/v2/core.js
index 98f9193..66c17ed 100644
--- a/js/v2/core.js
+++ b/js/v2/core.js
@@ -1,6 +1,6 @@
1/* 1/*
2 Cheetah News JS/v2 Core 2 Cheetah News JS/v2 Core
3 Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Wojciech Polak. 3 Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Wojciech Polak.
4 4
5 This program is free software; you can redistribute it and/or modify it 5 This program is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by the 6 under the terms of the GNU General Public License as published by the
@@ -1429,7 +1429,10 @@ function prepareEntry (n, feedid) {
1429 var anchor = n.getAttribute ('href'); 1429 var anchor = n.getAttribute ('href');
1430 if (anchor) { 1430 if (anchor) {
1431 var rel = n.getAttribute ('relative'); 1431 var rel = n.getAttribute ('relative');
1432 if (anchor.charAt (0) == '/' || (rel && rel == 'yes')) { 1432 if (anchor.indexOf ('//') == 0) {
1433 /* continue */
1434 }
1435 else if (anchor.charAt (0) == '/' || (rel && rel == 'yes')) {
1433 var cl = GID ('cl_' + feedid); 1436 var cl = GID ('cl_' + feedid);
1434 if (cl) { 1437 if (cl) {
1435 var pathname = ''; 1438 var pathname = '';
@@ -1552,7 +1555,10 @@ function prepareImages (n, feedid) {
1552 var osrc = n.getAttribute ('osrc'); 1555 var osrc = n.getAttribute ('osrc');
1553 if (osrc) { 1556 if (osrc) {
1554 var rel = n.getAttribute ('relative'); 1557 var rel = n.getAttribute ('relative');
1555 if (osrc.charAt (0) == '/' || (rel && rel == 'yes')) { 1558 if (osrc.indexOf ('//') == 0) {
1559 /* continue */
1560 }
1561 else if (osrc.charAt (0) == '/' || (rel && rel == 'yes')) {
1556 var cl = GID ('cl_' + feedid); 1562 var cl = GID ('cl_' + feedid);
1557 if (cl) { 1563 if (cl) {
1558 var pathname = ''; 1564 var pathname = '';

Return to:

Send suggestions and report system problems to the System administrator.