zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ph...@apache.org
Subject svn commit: r1495299 - in /zookeeper/site/trunk/content/doc: r3.1.2/api/ r3.2.2/api/ r3.3.2/api/ r3.3.3/api/ r3.3.4/api/ r3.3.5/api/ r3.3.6/api/ r3.4.0/api/ r3.4.1/api/ r3.4.2/api/ r3.4.3/api/ r3.4.4/api/ r3.4.5/api/
Date Fri, 21 Jun 2013 06:59:45 GMT
Author: phunt
Date: Fri Jun 21 06:59:45 2013
New Revision: 1495299

URL: http://svn.apache.org/r1495299
Log:
Fixed Frame injection vulnerability in published Javadoc recently identified/fixed by Oracle

Modified:
    zookeeper/site/trunk/content/doc/r3.1.2/api/index.html
    zookeeper/site/trunk/content/doc/r3.2.2/api/index.html
    zookeeper/site/trunk/content/doc/r3.3.2/api/index.html
    zookeeper/site/trunk/content/doc/r3.3.3/api/index.html
    zookeeper/site/trunk/content/doc/r3.3.4/api/index.html
    zookeeper/site/trunk/content/doc/r3.3.5/api/index.html
    zookeeper/site/trunk/content/doc/r3.3.6/api/index.html
    zookeeper/site/trunk/content/doc/r3.4.0/api/index.html
    zookeeper/site/trunk/content/doc/r3.4.1/api/index.html
    zookeeper/site/trunk/content/doc/r3.4.2/api/index.html
    zookeeper/site/trunk/content/doc/r3.4.3/api/index.html
    zookeeper/site/trunk/content/doc/r3.4.4/api/index.html
    zookeeper/site/trunk/content/doc/r3.4.5/api/index.html

Modified: zookeeper/site/trunk/content/doc/r3.1.2/api/index.html
URL: http://svn.apache.org/viewvc/zookeeper/site/trunk/content/doc/r3.1.2/api/index.html?rev=1495299&r1=1495298&r2=1495299&view=diff
==============================================================================
--- zookeeper/site/trunk/content/doc/r3.1.2/api/index.html (original)
+++ zookeeper/site/trunk/content/doc/r3.1.2/api/index.html Fri Jun 21 06:59:45 2013
@@ -12,6 +12,42 @@ ZooKeeper 3.1.2 API
         targetPage = targetPage.substring(1);
     if (targetPage.indexOf(":") != -1)
         targetPage = "undefined";
+    if (targetPage != "" && !validURL(targetPage))
+        targetPage = "undefined";
+    function validURL(url) {
+        var pos = url.indexOf(".html");
+        if (pos == -1 || pos != url.length - 5)
+            return false;
+        var allowNumber = false;
+        var allowSep = false;
+        var seenDot = false;
+        for (var i = 0; i < url.length - 5; i++) {
+            var ch = url.charAt(i);
+            if ('a' <= ch && ch <= 'z' ||
+                    'A' <= ch && ch <= 'Z' ||
+                    ch == '$' ||
+                    ch == '_') {
+                allowNumber = true;
+                allowSep = true;
+            } else if ('0' <= ch && ch <= '9'
+                    || ch == '-') {
+                if (!allowNumber)
+                     return false;
+            } else if (ch == '/' || ch == '.') {
+                if (!allowSep)
+                    return false;
+                allowNumber = false;
+                allowSep = false;
+                if (ch == '.')
+                     seenDot = true;
+                if (ch == '/' && seenDot)
+                     return false;
+            } else {
+                return false;
+            }
+        }
+        return true;
+    }
     function loadFrames() {
         if (targetPage != "" && targetPage != "undefined")
              top.classFrame.location = top.targetPage;

Modified: zookeeper/site/trunk/content/doc/r3.2.2/api/index.html
URL: http://svn.apache.org/viewvc/zookeeper/site/trunk/content/doc/r3.2.2/api/index.html?rev=1495299&r1=1495298&r2=1495299&view=diff
==============================================================================
--- zookeeper/site/trunk/content/doc/r3.2.2/api/index.html (original)
+++ zookeeper/site/trunk/content/doc/r3.2.2/api/index.html Fri Jun 21 06:59:45 2013
@@ -12,6 +12,42 @@ ZooKeeper 3.2.2 API
         targetPage = targetPage.substring(1);
     if (targetPage.indexOf(":") != -1)
         targetPage = "undefined";
+    if (targetPage != "" && !validURL(targetPage))
+        targetPage = "undefined";
+    function validURL(url) {
+        var pos = url.indexOf(".html");
+        if (pos == -1 || pos != url.length - 5)
+            return false;
+        var allowNumber = false;
+        var allowSep = false;
+        var seenDot = false;
+        for (var i = 0; i < url.length - 5; i++) {
+            var ch = url.charAt(i);
+            if ('a' <= ch && ch <= 'z' ||
+                    'A' <= ch && ch <= 'Z' ||
+                    ch == '$' ||
+                    ch == '_') {
+                allowNumber = true;
+                allowSep = true;
+            } else if ('0' <= ch && ch <= '9'
+                    || ch == '-') {
+                if (!allowNumber)
+                     return false;
+            } else if (ch == '/' || ch == '.') {
+                if (!allowSep)
+                    return false;
+                allowNumber = false;
+                allowSep = false;
+                if (ch == '.')
+                     seenDot = true;
+                if (ch == '/' && seenDot)
+                     return false;
+            } else {
+                return false;
+            }
+        }
+        return true;
+    }
     function loadFrames() {
         if (targetPage != "" && targetPage != "undefined")
              top.classFrame.location = top.targetPage;

Modified: zookeeper/site/trunk/content/doc/r3.3.2/api/index.html
URL: http://svn.apache.org/viewvc/zookeeper/site/trunk/content/doc/r3.3.2/api/index.html?rev=1495299&r1=1495298&r2=1495299&view=diff
==============================================================================
--- zookeeper/site/trunk/content/doc/r3.3.2/api/index.html (original)
+++ zookeeper/site/trunk/content/doc/r3.3.2/api/index.html Fri Jun 21 06:59:45 2013
@@ -12,6 +12,42 @@ ZooKeeper 3.3.2 API
         targetPage = targetPage.substring(1);
     if (targetPage.indexOf(":") != -1)
         targetPage = "undefined";
+    if (targetPage != "" && !validURL(targetPage))
+        targetPage = "undefined";
+    function validURL(url) {
+        var pos = url.indexOf(".html");
+        if (pos == -1 || pos != url.length - 5)
+            return false;
+        var allowNumber = false;
+        var allowSep = false;
+        var seenDot = false;
+        for (var i = 0; i < url.length - 5; i++) {
+            var ch = url.charAt(i);
+            if ('a' <= ch && ch <= 'z' ||
+                    'A' <= ch && ch <= 'Z' ||
+                    ch == '$' ||
+                    ch == '_') {
+                allowNumber = true;
+                allowSep = true;
+            } else if ('0' <= ch && ch <= '9'
+                    || ch == '-') {
+                if (!allowNumber)
+                     return false;
+            } else if (ch == '/' || ch == '.') {
+                if (!allowSep)
+                    return false;
+                allowNumber = false;
+                allowSep = false;
+                if (ch == '.')
+                     seenDot = true;
+                if (ch == '/' && seenDot)
+                     return false;
+            } else {
+                return false;
+            }
+        }
+        return true;
+    }
     function loadFrames() {
         if (targetPage != "" && targetPage != "undefined")
              top.classFrame.location = top.targetPage;

Modified: zookeeper/site/trunk/content/doc/r3.3.3/api/index.html
URL: http://svn.apache.org/viewvc/zookeeper/site/trunk/content/doc/r3.3.3/api/index.html?rev=1495299&r1=1495298&r2=1495299&view=diff
==============================================================================
--- zookeeper/site/trunk/content/doc/r3.3.3/api/index.html (original)
+++ zookeeper/site/trunk/content/doc/r3.3.3/api/index.html Fri Jun 21 06:59:45 2013
@@ -12,6 +12,42 @@ ZooKeeper 3.3.3 API
         targetPage = targetPage.substring(1);
     if (targetPage.indexOf(":") != -1)
         targetPage = "undefined";
+    if (targetPage != "" && !validURL(targetPage))
+        targetPage = "undefined";
+    function validURL(url) {
+        var pos = url.indexOf(".html");
+        if (pos == -1 || pos != url.length - 5)
+            return false;
+        var allowNumber = false;
+        var allowSep = false;
+        var seenDot = false;
+        for (var i = 0; i < url.length - 5; i++) {
+            var ch = url.charAt(i);
+            if ('a' <= ch && ch <= 'z' ||
+                    'A' <= ch && ch <= 'Z' ||
+                    ch == '$' ||
+                    ch == '_') {
+                allowNumber = true;
+                allowSep = true;
+            } else if ('0' <= ch && ch <= '9'
+                    || ch == '-') {
+                if (!allowNumber)
+                     return false;
+            } else if (ch == '/' || ch == '.') {
+                if (!allowSep)
+                    return false;
+                allowNumber = false;
+                allowSep = false;
+                if (ch == '.')
+                     seenDot = true;
+                if (ch == '/' && seenDot)
+                     return false;
+            } else {
+                return false;
+            }
+        }
+        return true;
+    }
     function loadFrames() {
         if (targetPage != "" && targetPage != "undefined")
              top.classFrame.location = top.targetPage;

Modified: zookeeper/site/trunk/content/doc/r3.3.4/api/index.html
URL: http://svn.apache.org/viewvc/zookeeper/site/trunk/content/doc/r3.3.4/api/index.html?rev=1495299&r1=1495298&r2=1495299&view=diff
==============================================================================
--- zookeeper/site/trunk/content/doc/r3.3.4/api/index.html (original)
+++ zookeeper/site/trunk/content/doc/r3.3.4/api/index.html Fri Jun 21 06:59:45 2013
@@ -12,6 +12,42 @@ ZooKeeper 3.3.4 API
         targetPage = targetPage.substring(1);
     if (targetPage.indexOf(":") != -1)
         targetPage = "undefined";
+    if (targetPage != "" && !validURL(targetPage))
+        targetPage = "undefined";
+    function validURL(url) {
+        var pos = url.indexOf(".html");
+        if (pos == -1 || pos != url.length - 5)
+            return false;
+        var allowNumber = false;
+        var allowSep = false;
+        var seenDot = false;
+        for (var i = 0; i < url.length - 5; i++) {
+            var ch = url.charAt(i);
+            if ('a' <= ch && ch <= 'z' ||
+                    'A' <= ch && ch <= 'Z' ||
+                    ch == '$' ||
+                    ch == '_') {
+                allowNumber = true;
+                allowSep = true;
+            } else if ('0' <= ch && ch <= '9'
+                    || ch == '-') {
+                if (!allowNumber)
+                     return false;
+            } else if (ch == '/' || ch == '.') {
+                if (!allowSep)
+                    return false;
+                allowNumber = false;
+                allowSep = false;
+                if (ch == '.')
+                     seenDot = true;
+                if (ch == '/' && seenDot)
+                     return false;
+            } else {
+                return false;
+            }
+        }
+        return true;
+    }
     function loadFrames() {
         if (targetPage != "" && targetPage != "undefined")
              top.classFrame.location = top.targetPage;

Modified: zookeeper/site/trunk/content/doc/r3.3.5/api/index.html
URL: http://svn.apache.org/viewvc/zookeeper/site/trunk/content/doc/r3.3.5/api/index.html?rev=1495299&r1=1495298&r2=1495299&view=diff
==============================================================================
--- zookeeper/site/trunk/content/doc/r3.3.5/api/index.html (original)
+++ zookeeper/site/trunk/content/doc/r3.3.5/api/index.html Fri Jun 21 06:59:45 2013
@@ -12,6 +12,42 @@ ZooKeeper 3.3.5 API
         targetPage = targetPage.substring(1);
     if (targetPage.indexOf(":") != -1)
         targetPage = "undefined";
+    if (targetPage != "" && !validURL(targetPage))
+        targetPage = "undefined";
+    function validURL(url) {
+        var pos = url.indexOf(".html");
+        if (pos == -1 || pos != url.length - 5)
+            return false;
+        var allowNumber = false;
+        var allowSep = false;
+        var seenDot = false;
+        for (var i = 0; i < url.length - 5; i++) {
+            var ch = url.charAt(i);
+            if ('a' <= ch && ch <= 'z' ||
+                    'A' <= ch && ch <= 'Z' ||
+                    ch == '$' ||
+                    ch == '_') {
+                allowNumber = true;
+                allowSep = true;
+            } else if ('0' <= ch && ch <= '9'
+                    || ch == '-') {
+                if (!allowNumber)
+                     return false;
+            } else if (ch == '/' || ch == '.') {
+                if (!allowSep)
+                    return false;
+                allowNumber = false;
+                allowSep = false;
+                if (ch == '.')
+                     seenDot = true;
+                if (ch == '/' && seenDot)
+                     return false;
+            } else {
+                return false;
+            }
+        }
+        return true;
+    }
     function loadFrames() {
         if (targetPage != "" && targetPage != "undefined")
              top.classFrame.location = top.targetPage;

Modified: zookeeper/site/trunk/content/doc/r3.3.6/api/index.html
URL: http://svn.apache.org/viewvc/zookeeper/site/trunk/content/doc/r3.3.6/api/index.html?rev=1495299&r1=1495298&r2=1495299&view=diff
==============================================================================
--- zookeeper/site/trunk/content/doc/r3.3.6/api/index.html (original)
+++ zookeeper/site/trunk/content/doc/r3.3.6/api/index.html Fri Jun 21 06:59:45 2013
@@ -12,6 +12,42 @@ ZooKeeper 3.3.6 API
         targetPage = targetPage.substring(1);
     if (targetPage.indexOf(":") != -1)
         targetPage = "undefined";
+    if (targetPage != "" && !validURL(targetPage))
+        targetPage = "undefined";
+    function validURL(url) {
+        var pos = url.indexOf(".html");
+        if (pos == -1 || pos != url.length - 5)
+            return false;
+        var allowNumber = false;
+        var allowSep = false;
+        var seenDot = false;
+        for (var i = 0; i < url.length - 5; i++) {
+            var ch = url.charAt(i);
+            if ('a' <= ch && ch <= 'z' ||
+                    'A' <= ch && ch <= 'Z' ||
+                    ch == '$' ||
+                    ch == '_') {
+                allowNumber = true;
+                allowSep = true;
+            } else if ('0' <= ch && ch <= '9'
+                    || ch == '-') {
+                if (!allowNumber)
+                     return false;
+            } else if (ch == '/' || ch == '.') {
+                if (!allowSep)
+                    return false;
+                allowNumber = false;
+                allowSep = false;
+                if (ch == '.')
+                     seenDot = true;
+                if (ch == '/' && seenDot)
+                     return false;
+            } else {
+                return false;
+            }
+        }
+        return true;
+    }
     function loadFrames() {
         if (targetPage != "" && targetPage != "undefined")
              top.classFrame.location = top.targetPage;

Modified: zookeeper/site/trunk/content/doc/r3.4.0/api/index.html
URL: http://svn.apache.org/viewvc/zookeeper/site/trunk/content/doc/r3.4.0/api/index.html?rev=1495299&r1=1495298&r2=1495299&view=diff
==============================================================================
--- zookeeper/site/trunk/content/doc/r3.4.0/api/index.html (original)
+++ zookeeper/site/trunk/content/doc/r3.4.0/api/index.html Fri Jun 21 06:59:45 2013
@@ -12,6 +12,42 @@ ZooKeeper 3.4.0 API
         targetPage = targetPage.substring(1);
     if (targetPage.indexOf(":") != -1)
         targetPage = "undefined";
+    if (targetPage != "" && !validURL(targetPage))
+        targetPage = "undefined";
+    function validURL(url) {
+        var pos = url.indexOf(".html");
+        if (pos == -1 || pos != url.length - 5)
+            return false;
+        var allowNumber = false;
+        var allowSep = false;
+        var seenDot = false;
+        for (var i = 0; i < url.length - 5; i++) {
+            var ch = url.charAt(i);
+            if ('a' <= ch && ch <= 'z' ||
+                    'A' <= ch && ch <= 'Z' ||
+                    ch == '$' ||
+                    ch == '_') {
+                allowNumber = true;
+                allowSep = true;
+            } else if ('0' <= ch && ch <= '9'
+                    || ch == '-') {
+                if (!allowNumber)
+                     return false;
+            } else if (ch == '/' || ch == '.') {
+                if (!allowSep)
+                    return false;
+                allowNumber = false;
+                allowSep = false;
+                if (ch == '.')
+                     seenDot = true;
+                if (ch == '/' && seenDot)
+                     return false;
+            } else {
+                return false;
+            }
+        }
+        return true;
+    }
     function loadFrames() {
         if (targetPage != "" && targetPage != "undefined")
              top.classFrame.location = top.targetPage;

Modified: zookeeper/site/trunk/content/doc/r3.4.1/api/index.html
URL: http://svn.apache.org/viewvc/zookeeper/site/trunk/content/doc/r3.4.1/api/index.html?rev=1495299&r1=1495298&r2=1495299&view=diff
==============================================================================
--- zookeeper/site/trunk/content/doc/r3.4.1/api/index.html (original)
+++ zookeeper/site/trunk/content/doc/r3.4.1/api/index.html Fri Jun 21 06:59:45 2013
@@ -12,6 +12,42 @@ ZooKeeper 3.4.1 API
         targetPage = targetPage.substring(1);
     if (targetPage.indexOf(":") != -1)
         targetPage = "undefined";
+    if (targetPage != "" && !validURL(targetPage))
+        targetPage = "undefined";
+    function validURL(url) {
+        var pos = url.indexOf(".html");
+        if (pos == -1 || pos != url.length - 5)
+            return false;
+        var allowNumber = false;
+        var allowSep = false;
+        var seenDot = false;
+        for (var i = 0; i < url.length - 5; i++) {
+            var ch = url.charAt(i);
+            if ('a' <= ch && ch <= 'z' ||
+                    'A' <= ch && ch <= 'Z' ||
+                    ch == '$' ||
+                    ch == '_') {
+                allowNumber = true;
+                allowSep = true;
+            } else if ('0' <= ch && ch <= '9'
+                    || ch == '-') {
+                if (!allowNumber)
+                     return false;
+            } else if (ch == '/' || ch == '.') {
+                if (!allowSep)
+                    return false;
+                allowNumber = false;
+                allowSep = false;
+                if (ch == '.')
+                     seenDot = true;
+                if (ch == '/' && seenDot)
+                     return false;
+            } else {
+                return false;
+            }
+        }
+        return true;
+    }
     function loadFrames() {
         if (targetPage != "" && targetPage != "undefined")
              top.classFrame.location = top.targetPage;

Modified: zookeeper/site/trunk/content/doc/r3.4.2/api/index.html
URL: http://svn.apache.org/viewvc/zookeeper/site/trunk/content/doc/r3.4.2/api/index.html?rev=1495299&r1=1495298&r2=1495299&view=diff
==============================================================================
--- zookeeper/site/trunk/content/doc/r3.4.2/api/index.html (original)
+++ zookeeper/site/trunk/content/doc/r3.4.2/api/index.html Fri Jun 21 06:59:45 2013
@@ -12,6 +12,42 @@ ZooKeeper 3.4.2 API
         targetPage = targetPage.substring(1);
     if (targetPage.indexOf(":") != -1)
         targetPage = "undefined";
+    if (targetPage != "" && !validURL(targetPage))
+        targetPage = "undefined";
+    function validURL(url) {
+        var pos = url.indexOf(".html");
+        if (pos == -1 || pos != url.length - 5)
+            return false;
+        var allowNumber = false;
+        var allowSep = false;
+        var seenDot = false;
+        for (var i = 0; i < url.length - 5; i++) {
+            var ch = url.charAt(i);
+            if ('a' <= ch && ch <= 'z' ||
+                    'A' <= ch && ch <= 'Z' ||
+                    ch == '$' ||
+                    ch == '_') {
+                allowNumber = true;
+                allowSep = true;
+            } else if ('0' <= ch && ch <= '9'
+                    || ch == '-') {
+                if (!allowNumber)
+                     return false;
+            } else if (ch == '/' || ch == '.') {
+                if (!allowSep)
+                    return false;
+                allowNumber = false;
+                allowSep = false;
+                if (ch == '.')
+                     seenDot = true;
+                if (ch == '/' && seenDot)
+                     return false;
+            } else {
+                return false;
+            }
+        }
+        return true;
+    }
     function loadFrames() {
         if (targetPage != "" && targetPage != "undefined")
              top.classFrame.location = top.targetPage;

Modified: zookeeper/site/trunk/content/doc/r3.4.3/api/index.html
URL: http://svn.apache.org/viewvc/zookeeper/site/trunk/content/doc/r3.4.3/api/index.html?rev=1495299&r1=1495298&r2=1495299&view=diff
==============================================================================
--- zookeeper/site/trunk/content/doc/r3.4.3/api/index.html (original)
+++ zookeeper/site/trunk/content/doc/r3.4.3/api/index.html Fri Jun 21 06:59:45 2013
@@ -12,6 +12,42 @@ ZooKeeper 3.4.3 API
         targetPage = targetPage.substring(1);
     if (targetPage.indexOf(":") != -1)
         targetPage = "undefined";
+    if (targetPage != "" && !validURL(targetPage))
+        targetPage = "undefined";
+    function validURL(url) {
+        var pos = url.indexOf(".html");
+        if (pos == -1 || pos != url.length - 5)
+            return false;
+        var allowNumber = false;
+        var allowSep = false;
+        var seenDot = false;
+        for (var i = 0; i < url.length - 5; i++) {
+            var ch = url.charAt(i);
+            if ('a' <= ch && ch <= 'z' ||
+                    'A' <= ch && ch <= 'Z' ||
+                    ch == '$' ||
+                    ch == '_') {
+                allowNumber = true;
+                allowSep = true;
+            } else if ('0' <= ch && ch <= '9'
+                    || ch == '-') {
+                if (!allowNumber)
+                     return false;
+            } else if (ch == '/' || ch == '.') {
+                if (!allowSep)
+                    return false;
+                allowNumber = false;
+                allowSep = false;
+                if (ch == '.')
+                     seenDot = true;
+                if (ch == '/' && seenDot)
+                     return false;
+            } else {
+                return false;
+            }
+        }
+        return true;
+    }
     function loadFrames() {
         if (targetPage != "" && targetPage != "undefined")
              top.classFrame.location = top.targetPage;

Modified: zookeeper/site/trunk/content/doc/r3.4.4/api/index.html
URL: http://svn.apache.org/viewvc/zookeeper/site/trunk/content/doc/r3.4.4/api/index.html?rev=1495299&r1=1495298&r2=1495299&view=diff
==============================================================================
--- zookeeper/site/trunk/content/doc/r3.4.4/api/index.html (original)
+++ zookeeper/site/trunk/content/doc/r3.4.4/api/index.html Fri Jun 21 06:59:45 2013
@@ -12,6 +12,42 @@ ZooKeeper 3.4.4 API
         targetPage = targetPage.substring(1);
     if (targetPage.indexOf(":") != -1)
         targetPage = "undefined";
+    if (targetPage != "" && !validURL(targetPage))
+        targetPage = "undefined";
+    function validURL(url) {
+        var pos = url.indexOf(".html");
+        if (pos == -1 || pos != url.length - 5)
+            return false;
+        var allowNumber = false;
+        var allowSep = false;
+        var seenDot = false;
+        for (var i = 0; i < url.length - 5; i++) {
+            var ch = url.charAt(i);
+            if ('a' <= ch && ch <= 'z' ||
+                    'A' <= ch && ch <= 'Z' ||
+                    ch == '$' ||
+                    ch == '_') {
+                allowNumber = true;
+                allowSep = true;
+            } else if ('0' <= ch && ch <= '9'
+                    || ch == '-') {
+                if (!allowNumber)
+                     return false;
+            } else if (ch == '/' || ch == '.') {
+                if (!allowSep)
+                    return false;
+                allowNumber = false;
+                allowSep = false;
+                if (ch == '.')
+                     seenDot = true;
+                if (ch == '/' && seenDot)
+                     return false;
+            } else {
+                return false;
+            }
+        }
+        return true;
+    }
     function loadFrames() {
         if (targetPage != "" && targetPage != "undefined")
              top.classFrame.location = top.targetPage;

Modified: zookeeper/site/trunk/content/doc/r3.4.5/api/index.html
URL: http://svn.apache.org/viewvc/zookeeper/site/trunk/content/doc/r3.4.5/api/index.html?rev=1495299&r1=1495298&r2=1495299&view=diff
==============================================================================
--- zookeeper/site/trunk/content/doc/r3.4.5/api/index.html (original)
+++ zookeeper/site/trunk/content/doc/r3.4.5/api/index.html Fri Jun 21 06:59:45 2013
@@ -12,6 +12,42 @@ ZooKeeper 3.4.5 API
         targetPage = targetPage.substring(1);
     if (targetPage.indexOf(":") != -1)
         targetPage = "undefined";
+    if (targetPage != "" && !validURL(targetPage))
+        targetPage = "undefined";
+    function validURL(url) {
+        var pos = url.indexOf(".html");
+        if (pos == -1 || pos != url.length - 5)
+            return false;
+        var allowNumber = false;
+        var allowSep = false;
+        var seenDot = false;
+        for (var i = 0; i < url.length - 5; i++) {
+            var ch = url.charAt(i);
+            if ('a' <= ch && ch <= 'z' ||
+                    'A' <= ch && ch <= 'Z' ||
+                    ch == '$' ||
+                    ch == '_') {
+                allowNumber = true;
+                allowSep = true;
+            } else if ('0' <= ch && ch <= '9'
+                    || ch == '-') {
+                if (!allowNumber)
+                     return false;
+            } else if (ch == '/' || ch == '.') {
+                if (!allowSep)
+                    return false;
+                allowNumber = false;
+                allowSep = false;
+                if (ch == '.')
+                     seenDot = true;
+                if (ch == '/' && seenDot)
+                     return false;
+            } else {
+                return false;
+            }
+        }
+        return true;
+    }
     function loadFrames() {
         if (targetPage != "" && targetPage != "undefined")
              top.classFrame.location = top.targetPage;



Mime
View raw message