summaryrefslogtreecommitdiffabout
authorWojciech Polak <polak@gnu.org>2011-10-08 08:52:07 (GMT)
committer Wojciech Polak <polak@gnu.org>2011-10-08 08:52:07 (GMT)
commitda57070b7ed9cee48166d3b30dbc3baba793ed06 (patch) (side-by-side diff)
tree7a6585f60cbf8b1b61b98e352de15180a3200efb
parent1598b0c775b62872bb504dbce557db2003ada826 (diff)
downloadcheetah-da57070b7ed9cee48166d3b30dbc3baba793ed06.tar.gz
cheetah-da57070b7ed9cee48166d3b30dbc3baba793ed06.tar.bz2
Add protocol-relative links support.
Diffstat (more/less context) (ignore whitespace changes)
-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 @@
/*
Cheetah News JS/v2 Core
- Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Wojciech Polak.
+ Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Wojciech Polak.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@@ -1429,7 +1429,10 @@ function prepareEntry (n, feedid) {
var anchor = n.getAttribute ('href');
if (anchor) {
var rel = n.getAttribute ('relative');
- if (anchor.charAt (0) == '/' || (rel && rel == 'yes')) {
+ if (anchor.indexOf ('//') == 0) {
+ /* continue */
+ }
+ else if (anchor.charAt (0) == '/' || (rel && rel == 'yes')) {
var cl = GID ('cl_' + feedid);
if (cl) {
var pathname = '';
@@ -1552,7 +1555,10 @@ function prepareImages (n, feedid) {
var osrc = n.getAttribute ('osrc');
if (osrc) {
var rel = n.getAttribute ('relative');
- if (osrc.charAt (0) == '/' || (rel && rel == 'yes')) {
+ if (osrc.indexOf ('//') == 0) {
+ /* continue */
+ }
+ else if (osrc.charAt (0) == '/' || (rel && rel == 'yes')) {
var cl = GID ('cl_' + feedid);
if (cl) {
var pathname = '';

Return to:

Send suggestions and report system problems to the System administrator.