Author: nick
Date: Thu Jun 20 11:03:56 2013
New Revision: 1494927

URL: http://svn.apache.org/r1494927
Log:
Apply the Javadoc updater fix for CVE-2013-1571. Future JavaDoc generation 
should be done with a newer JVM that includes the fix

Modified:
    poi/site/publish/apidocs/index.html

Modified: poi/site/publish/apidocs/index.html
URL: 
http://svn.apache.org/viewvc/poi/site/publish/apidocs/index.html?rev=1494927&r1=1494926&r2=1494927&view=diff
==============================================================================
--- poi/site/publish/apidocs/index.html (original)
+++ poi/site/publish/apidocs/index.html Thu Jun 20 11:03:56 2013
@@ -11,6 +11,42 @@ POI API Documentation
         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;



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to