0001: /*
0002: * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
0003: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
0004: */
0005: package com.sun.portal.rewriter.engines.js.test;
0006:
0007: import com.sun.portal.rewriter.AbsoluteTranslator;
0008: import com.sun.portal.rewriter.Rewriter;
0009: import com.sun.portal.rewriter.RewriterModule;
0010: import com.sun.portal.rewriter.RewriterPool;
0011: import com.sun.portal.rewriter.Translator;
0012: import com.sun.portal.rewriter.engines.LanguageConstants;
0013: import com.sun.portal.rewriter.rom.RuleSet;
0014: import com.sun.portal.rewriter.test.util.BasicTestCase;
0015: import com.sun.portal.rewriter.test.util.CreateRuleSet;
0016: import com.sun.portal.rewriter.test.util.JSWrapperHelper;
0017: import com.sun.portal.rewriter.util.Resource;
0018: import com.sun.portal.rewriter.util.uri.PageSpec;
0019: import junit.framework.TestSuite;
0020:
0021: public class TestJSGeneralTwo extends BasicTestCase {
0022: public TestJSGeneralTwo(String aName) {
0023: super (aName);
0024: }//constuctor
0025:
0026: public void testBugNo4747776GooglePage() throws Exception {
0027: String lInput = "<html><head><meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\"><title>Google</title><style><!--\n"
0028: + "body,td,a,p,.h{font-family:arial,sans-serif;} .h{font-size: 20px;} .h{color:} .q{text-decoration:none; color:#0000cc;}\n"
0029: + "//--></style>\n"
0030: + "<script>\n"
0031: + "<!--\n"
0032: + "function sf(){document.f.q.focus();}\n"
0033: + "function c(p){var f=document.f;if (f.action) {f.action = 'http://'+p;f.submit();return false;}return true;}\n"
0034: + "// -->\n"
0035: + "</script>\n"
0036: + "</head><body bgcolor=#ffffff text=#000000 link=#0000cc vlink=#551a8b alink=#ff0000 onLoad=sf()><center><table border=0 cellspacing=0 cellpadding=0><tr><td><img src=\"images/logo.gif\" width=276 height=110 alt=\"Google\"></td></tr></table><br>\n"
0037: + "<table border=0 cellspacing=0 cellpadding=0><tr><td width=15> </td><td id=0 bgcolor=#3366cc align=center width=120 nowrap><font color=#ffffff size=-1><b>Web</b></font></td><td width=15> </td><td id=1 bgcolor=#efefef align=center width=120 nowrap onClick=\"return c('www.google.com/imghp');\" style=cursor:pointer;cursor:hand;><a id=1a class=q href=\"/imghp?hl=en&ie=UTF-8&oe=UTF-8\" onClick=\"return c('www.google.com/imghp');\"><font size=-1>Images</font></a></td><td width=15> </td><td id=2 bgcolor=#efefef align=center width=120 nowrap onClick=\"return c('www.google.com/grphp');\" style=cursor:pointer;cursor:hand;><a id=2a class=q href=\"/grphp?hl=en&ie=UTF-8&oe=UTF-8\" onClick=\"return c('www.google.com/grphp');\"><font size=-1>Groups</font></a></td><td width=15> </td><td id=3 bgcolor=#efefef align=center width=120 nowrap onClick=\"return c('www.google.com/dirhp');\" style=cursor:pointer;cursor:hand;><a id=3a class=q href=\"/dirhp?hl=en&ie=UTF-8&oe=UTF-8\" onClick=\"return c('www.google.com/dirhp');\"><font size=-1>Directory</font></a></td><td width=15> </td></tr><tr><td colspan=10 bgcolor=#3366cc><img width=1 height=1 alt=\"\"></td></tr></table><br><form action=\"/search\" name=f><table cellspacing=0 cellpadding=0><tr><td width=75> </td><td align=center><input type=hidden name=hl value=en><input type=hidden name=ie value=\"UTF-8\"><input type=hidden name=oe value=\"UTF-8\"><input maxLength=256 size=55 name=q value=\"\"><br><input type=submit value=\"Google Search\" name=btnG><input type=submit value=\"I'm Feeling Lucky\" name=btnI></td><td valign=top nowrap><font size=-2> • <a href=/advanced_search?hl=en>Advanced Search</a><br> • <a href=/preferences?hl=en>Preferences</a><br> • <a href=/language_tools?hl=en>Language Tools</a></font></td></tr></table></form><br>\n"
0038: + "<br><font size=-1><a href=\"/ads/\">Advertise with Us</a> - <a href=\"/services/\">Search Solutions</a> - <a href=\"/news/\">News and Resources</a> - <a href=\"/options/\">Services & Tools</a> - <a href=/about.html>Jobs, Press, Cool Stuff...</a><span id=hp style=\"behavior:url(#default#homepage)\"></span>\n"
0039: + "<script>\n"
0040: + "if (!hp.isHomePage('http://www.google.com/')) {document.write(\"<p><a href=\\\"/mgyhp.html\\\" onClick=\\\"style.behavior='url(#default#homepage)';setHomePage('http://www.google.com/');\\\">Make Google Your Homepage!</a>\");}\n"
0041: + "</script></font>\n"
0042: + "<p><font size=-2>©2002 Google</font><font size=-2> - Searching 2,469,940,685 web pages</font></center></body></html>\n";
0043:
0044: String lExpectation = "<html><head><meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\"><title>Google</title><style><!--\n"
0045: + "body,td,a,p,.h{font-family:arial,sans-serif;} .h{font-size: 20px;} .h{color:} .q{text-decoration:none; color:#0000cc;}\n"
0046: + "//--></style>\n"
0047: + JSWrapperHelper.CONVERT_EXPRESSION_FUNCTION_HTML
0048: + "<script>\n"
0049: + "<!--\n"
0050: + "function sf(){document.f.q.focus();}\n"
0051: + "function c(p){var f=document.f;if (f.action) {f.action ="
0052: + JSWrapperHelper.CONVERT_EXPRESSION_FUNCTION_WRAP_START
0053: + " 'http://'+p);f.submit();return false;}return true;}\n"
0054: + "// -->\n"
0055: + "</script>\n"
0056: + "</head><body bgcolor=#ffffff text=#000000 link=#0000cc vlink=#551a8b alink=#ff0000 onLoad=sf()><center><table border=0 cellspacing=0 cellpadding=0><tr><td><img src=\"http://rajanagendra.sun.com/Base/Raja/images/logo.gif\" width=276 height=110 alt=\"Google\"></td></tr></table><br>\n"
0057: + "<table border=0 cellspacing=0 cellpadding=0><tr><td width=15> </td><td id=0 bgcolor=#3366cc align=center width=120 nowrap><font color=#ffffff size=-1><b>Web</b></font></td><td width=15> </td><td id=1 bgcolor=#efefef align=center width=120 nowrap onClick=\"return c('www.google.com/imghp');\" style=cursor:pointer;cursor:hand;><a id=1a class=q href=\"http://rajanagendra.sun.com/imghp?hl=en&ie=UTF-8&oe=UTF-8\" onClick=\"return c('www.google.com/imghp');\"><font size=-1>Images</font></a></td><td width=15> </td><td id=2 bgcolor=#efefef align=center width=120 nowrap onClick=\"return c('www.google.com/grphp');\" style=cursor:pointer;cursor:hand;><a id=2a class=q href=\"http://rajanagendra.sun.com/grphp?hl=en&ie=UTF-8&oe=UTF-8\" onClick=\"return c('www.google.com/grphp');\"><font size=-1>Groups</font></a></td><td width=15> </td><td id=3 bgcolor=#efefef align=center width=120 nowrap onClick=\"return c('www.google.com/dirhp');\" style=cursor:pointer;cursor:hand;><a id=3a class=q href=\"http://rajanagendra.sun.com/dirhp?hl=en&ie=UTF-8&oe=UTF-8\" onClick=\"return c('www.google.com/dirhp');\"><font size=-1>Directory</font></a></td><td width=15> </td></tr><tr><td colspan=10 bgcolor=#3366cc><img width=1 height=1 alt=\"\"></td></tr></table><br><form action=\"http://rajanagendra.sun.com/search\" name=f><table cellspacing=0 cellpadding=0><tr><td width=75> </td><td align=center><input type=hidden name=hl value=en><input type=hidden name=ie value=\"UTF-8\"><input type=hidden name=oe value=\"UTF-8\"><input maxLength=256 size=55 name=q value=\"\"><br><input type=submit value=\"Google Search\" name=btnG><input type=submit value=\"I'm Feeling Lucky\" name=btnI></td><td valign=top nowrap><font size=-2> • <a href=http://rajanagendra.sun.com/advanced_search?hl=en>Advanced Search</a><br> • <a href=http://rajanagendra.sun.com/preferences?hl=en>Preferences</a><br> • <a href=http://rajanagendra.sun.com/language_tools?hl=en>Language Tools</a></font></td></tr></table></form><br>\n"
0058: + "<br><font size=-1><a href=\"http://rajanagendra.sun.com/ads/\">Advertise with Us</a> - <a href=\"http://rajanagendra.sun.com/services/\">Search Solutions</a> - <a href=\"http://rajanagendra.sun.com/news/\">News and Resources</a> - <a href=\"http://rajanagendra.sun.com/options/\">Services & Tools</a> - <a href=http://rajanagendra.sun.com/about.html>Jobs, Press, Cool Stuff...</a><span id=hp style=\"behavior:url(#default#homepage)\"></span>\n"
0059: + "<script>\n"
0060: + "if (!hp.isHomePage('http://www.google.com/')) {document.write(\"<p>"
0061: + "<a href=\\\"http://rajanagendra.sun.com/mgyhp.html\\\" onClick=\\\"style.behavior='url(#default#homepage)';setHomePage('http://www.google.com/');\\\">Make Google Your Homepage!</a>\");}\n"
0062: + "</script></font>\n"
0063: + "<p><font size=-2>©2002 Google</font><font size=-2> - Searching 2,469,940,685 web pages</font></center></body></html>\n";
0064:
0065: String lAttRule = "<Attribute name=\"action\" tag=\"ForM\"/><Attribute name=\"hReF\" tag=\"a\"/><Attribute name=\"src\" tag=\"img\"/><Attribute name=\"code*se\"/>";
0066: String lHTMLJSTokenRules = "<Attribute name=\"ON*\" type=\"DJS\"/>";
0067: String lJSVarRules = "<Variable name=\"*.action\" type=\"EXPRESSION\"/>"
0068: + "<Variable name=\"*location.href\" type=\"EXPRESSION\"/>";
0069: String lJSFunRule = "<Function type=\"DHTML\" name=\"document.write*\" paramPatterns=\"y\"/>";
0070:
0071: RuleSet lRuleSet = CreateRuleSet
0072: .withHTMLAttJSTokenJSVarJSFunRules(lAttRule,
0073: lHTMLJSTokenRules, lJSVarRules, lJSFunRule);
0074:
0075: Rewriter lRewriter = RewriterPool.create(lRuleSet,
0076: LanguageConstants.HTML_MIME);
0077: String lResult = lRewriter.rewrite(lInput,
0078: getDefaultTranslator());
0079: assertEquals(lExpectation, lResult);
0080: }//testBugNo4747776GooglePage()
0081:
0082: public void testBugNo4747776YahooMailPage() throws Exception {
0083: String lInput = "<html>\n"
0084: + "<head>\n"
0085: + "<script language=\"javascript\" src=\"http://us.i1.yimg.com/us.yimg.com/i/mc/mc.js\">\n"
0086: + "</script>\n"
0087: + "<meta http-equiv=\"pics-label\" content='(pics-1.1 \"http://www.icra.org/ratingsv02.html\" l gen true for \"http://mail.yahoo.com\" r ( nz 0 vz 0 lz 0 oz 0 ca 1))'>\n"
0088: + "<title>Yahoo! Mail - The best free web-based email!</title>\n"
0089: + "</head>\n"
0090: + "<body bgcolor=#ffffff\n"
0091: + "onload=\"document.login_form.login.focus();\">\n"
0092: + "<center>\n"
0093: + "<script language=\"JavaScript\">\n"
0094: + "<!--\n"
0095: + "hasMsgr = 0;\n"
0096: + "function dontGotIt(){\n"
0097: + " hasMsgr = 0;\n"
0098: + " document.login_form.hasMsgr.value=0;\n"
0099: + "}\n"
0100: + "\n"
0101: + "function doGotIt(){\n"
0102: + " hasMsgr = 1;\n"
0103: + " document.login_form.hasMsgr.value=1;\n"
0104: + "}\n"
0105: + "//-->\n"
0106: + "</script>\n"
0107: + "\n"
0108: + "<script language=\"javascript\">\n"
0109: + "/*\n"
0110: + " * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n"
0111: + " * Digest Algorithm, as defined in RFC 1321.\n"
0112: + " * Copyright (C) Paul Johnston 1999 - 2000.\n"
0113: + " * Updated by Greg Holt 2000 - 2001.\n"
0114: + " * See http://pajhome.org.uk/site/legal.html for details.\n"
0115: + " */\n"
0116: + "\n"
0117: + "/*\n"
0118: + " * Convert a 32-bit number to a hex string with ls-byte first\n"
0119: + " */\n"
0120: + "var hex_chr = \"0123456789abcdef\";\n"
0121: + "function rhex(num)\n"
0122: + "{\n"
0123: + " str = \"\";\n"
0124: + " for(j = 0; j <= 3; j++)\n"
0125: + " str += hex_chr.charAt((num >> (j * 8 + 4)) & 0x0F) +\n"
0126: + " hex_chr.charAt((num >> (j * 8)) & 0x0F);\n"
0127: + " return str;\n"
0128: + "}\n"
0129: + "\n"
0130: + "/*\n"
0131: + " * Convert a string to a sequence of 16-word blocks, stored as an array.\n"
0132: + " * Append padding bits and the length, as described in the MD5 standard.\n"
0133: + " */\n"
0134: + "function str2blks_MD5(str)\n"
0135: + "{\n"
0136: + " nblk = ((str.length + 8) >> 6) + 1;\n"
0137: + " blks = new Array(nblk * 16);\n"
0138: + " for(i = 0; i < nblk * 16; i++) blks[i] = 0;\n"
0139: + " for(i = 0; i < str.length; i++)\n"
0140: + " blks[i >> 2] |= str.charCodeAt(i) << ((i % 4) * 8);\n"
0141: + " blks[i >> 2] |= 0x80 << ((i % 4) * 8);\n"
0142: + " blks[nblk * 16 - 2] = str.length * 8;\n"
0143: + " return blks;\n"
0144: + "}\n"
0145: + "\n"
0146: + "/*\n"
0147: + " * Add integers, wrapping at 2^32. This uses 16-bit operations internally \n"
0148: + " * to work around bugs in some JS interpreters.\n"
0149: + " */\n"
0150: + "function add(x, y)\n"
0151: + "{\n"
0152: + " var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n"
0153: + " var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n"
0154: + " return (msw << 16) | (lsw & 0xFFFF);\n"
0155: + "}\n"
0156: + "\n"
0157: + "/*\n"
0158: + " * Bitwise rotate a 32-bit number to the left\n"
0159: + " */\n"
0160: + "function rol(num, cnt)\n"
0161: + "{\n"
0162: + " return (num << cnt) | (num >>> (32 - cnt));\n"
0163: + "}\n"
0164: + "\n"
0165: + "/*\n"
0166: + " * These functions implement the basic operation for each round of the\n"
0167: + " * algorithm.\n"
0168: + " */\n"
0169: + "function cmn(q, a, b, x, s, t)\n"
0170: + "{\n"
0171: + " return add(rol(add(add(a, q), add(x, t)), s), b);\n"
0172: + "}\n"
0173: + "function ff(a, b, c, d, x, s, t)\n"
0174: + "{\n"
0175: + " return cmn((b & c) | ((~b) & d), a, b, x, s, t);\n"
0176: + "}\n"
0177: + "function gg(a, b, c, d, x, s, t)\n"
0178: + "{\n"
0179: + " return cmn((b & d) | (c & (~d)), a, b, x, s, t);\n"
0180: + "}\n"
0181: + "function hh(a, b, c, d, x, s, t)\n"
0182: + "{\n"
0183: + " return cmn(b ^ c ^ d, a, b, x, s, t);\n"
0184: + "}\n"
0185: + "function ii(a, b, c, d, x, s, t)\n"
0186: + "{\n"
0187: + " return cmn(c ^ (b | (~d)), a, b, x, s, t);\n"
0188: + "}\n"
0189: + "\n"
0190: + "/*\n"
0191: + " * Take a string and return the hex representation of its MD5.\n"
0192: + " */\n"
0193: + "function MD5(str)\n"
0194: + "{\n"
0195: + " x = str2blks_MD5(str);\n"
0196: + " var a = 1732584193;\n"
0197: + " var b = -271733879;\n"
0198: + " var c = -1732584194;\n"
0199: + " var d = 271733878;\n"
0200: + " \n"
0201: + " for(i = 0; i < x.length; i += 16)\n"
0202: + " {\n"
0203: + " var olda = a;\n"
0204: + " var oldb = b;\n"
0205: + " var oldc = c;\n"
0206: + " var oldd = d;\n"
0207: + "\n"
0208: + " a = ff(a, b, c, d, x[i+ 0], 7 , -680876936);\n"
0209: + " d = ff(d, a, b, c, x[i+ 1], 12, -389564586);\n"
0210: + " c = ff(c, d, a, b, x[i+ 2], 17, 606105819);\n"
0211: + " b = ff(b, c, d, a, x[i+ 3], 22, -1044525330);\n"
0212: + " a = ff(a, b, c, d, x[i+ 4], 7 , -176418897);\n"
0213: + " d = ff(d, a, b, c, x[i+ 5], 12, 1200080426);\n"
0214: + " c = ff(c, d, a, b, x[i+ 6], 17, -1473231341);\n"
0215: + " b = ff(b, c, d, a, x[i+ 7], 22, -45705983);\n"
0216: + " a = ff(a, b, c, d, x[i+ 8], 7 , 1770035416);\n"
0217: + " d = ff(d, a, b, c, x[i+ 9], 12, -1958414417);\n"
0218: + " c = ff(c, d, a, b, x[i+10], 17, -42063);\n"
0219: + " b = ff(b, c, d, a, x[i+11], 22, -1990404162);\n"
0220: + " a = ff(a, b, c, d, x[i+12], 7 , 1804603682);\n"
0221: + " d = ff(d, a, b, c, x[i+13], 12, -40341101);\n"
0222: + " c = ff(c, d, a, b, x[i+14], 17, -1502002290);\n"
0223: + " b = ff(b, c, d, a, x[i+15], 22, 1236535329); \n"
0224: + "\n"
0225: + " a = gg(a, b, c, d, x[i+ 1], 5 , -165796510);\n"
0226: + " d = gg(d, a, b, c, x[i+ 6], 9 , -1069501632);\n"
0227: + " c = gg(c, d, a, b, x[i+11], 14, 643717713);\n"
0228: + " b = gg(b, c, d, a, x[i+ 0], 20, -373897302);\n"
0229: + " a = gg(a, b, c, d, x[i+ 5], 5 , -701558691);\n"
0230: + " d = gg(d, a, b, c, x[i+10], 9 , 38016083);\n"
0231: + " c = gg(c, d, a, b, x[i+15], 14, -660478335);\n"
0232: + " b = gg(b, c, d, a, x[i+ 4], 20, -405537848);\n"
0233: + " a = gg(a, b, c, d, x[i+ 9], 5 , 568446438);\n"
0234: + " d = gg(d, a, b, c, x[i+14], 9 , -1019803690);\n"
0235: + " c = gg(c, d, a, b, x[i+ 3], 14, -187363961);\n"
0236: + " b = gg(b, c, d, a, x[i+ 8], 20, 1163531501);\n"
0237: + " a = gg(a, b, c, d, x[i+13], 5 , -1444681467);\n"
0238: + " d = gg(d, a, b, c, x[i+ 2], 9 , -51403784);\n"
0239: + " c = gg(c, d, a, b, x[i+ 7], 14, 1735328473);\n"
0240: + " b = gg(b, c, d, a, x[i+12], 20, -1926607734);\n"
0241: + " \n"
0242: + " a = hh(a, b, c, d, x[i+ 5], 4 , -378558);\n"
0243: + " d = hh(d, a, b, c, x[i+ 8], 11, -2022574463);\n"
0244: + " c = hh(c, d, a, b, x[i+11], 16, 1839030562);\n"
0245: + " b = hh(b, c, d, a, x[i+14], 23, -35309556);\n"
0246: + " a = hh(a, b, c, d, x[i+ 1], 4 , -1530992060);\n"
0247: + " d = hh(d, a, b, c, x[i+ 4], 11, 1272893353);\n"
0248: + " c = hh(c, d, a, b, x[i+ 7], 16, -155497632);\n"
0249: + " b = hh(b, c, d, a, x[i+10], 23, -1094730640);\n"
0250: + " a = hh(a, b, c, d, x[i+13], 4 , 681279174);\n"
0251: + " d = hh(d, a, b, c, x[i+ 0], 11, -358537222);\n"
0252: + " c = hh(c, d, a, b, x[i+ 3], 16, -722521979);\n"
0253: + " b = hh(b, c, d, a, x[i+ 6], 23, 76029189);\n"
0254: + " a = hh(a, b, c, d, x[i+ 9], 4 , -640364487);\n"
0255: + " d = hh(d, a, b, c, x[i+12], 11, -421815835);\n"
0256: + " c = hh(c, d, a, b, x[i+15], 16, 530742520);\n"
0257: + " b = hh(b, c, d, a, x[i+ 2], 23, -995338651);\n"
0258: + "\n"
0259: + " a = ii(a, b, c, d, x[i+ 0], 6 , -198630844);\n"
0260: + " d = ii(d, a, b, c, x[i+ 7], 10, 1126891415);\n"
0261: + " c = ii(c, d, a, b, x[i+14], 15, -1416354905);\n"
0262: + " b = ii(b, c, d, a, x[i+ 5], 21, -57434055);\n"
0263: + " a = ii(a, b, c, d, x[i+12], 6 , 1700485571);\n"
0264: + " d = ii(d, a, b, c, x[i+ 3], 10, -1894986606);\n"
0265: + " c = ii(c, d, a, b, x[i+10], 15, -1051523);\n"
0266: + " b = ii(b, c, d, a, x[i+ 1], 21, -2054922799);\n"
0267: + " a = ii(a, b, c, d, x[i+ 8], 6 , 1873313359);\n"
0268: + " d = ii(d, a, b, c, x[i+15], 10, -30611744);\n"
0269: + " c = ii(c, d, a, b, x[i+ 6], 15, -1560198380);\n"
0270: + " b = ii(b, c, d, a, x[i+13], 21, 1309151649);\n"
0271: + " a = ii(a, b, c, d, x[i+ 4], 6 , -145523070);\n"
0272: + " d = ii(d, a, b, c, x[i+11], 10, -1120210379);\n"
0273: + " c = ii(c, d, a, b, x[i+ 2], 15, 718787259);\n"
0274: + " b = ii(b, c, d, a, x[i+ 9], 21, -343485551);\n"
0275: + "\n"
0276: + " a = add(a, olda);\n"
0277: + " b = add(b, oldb);\n"
0278: + " c = add(c, oldc);\n"
0279: + " d = add(d, oldd);\n"
0280: + " }\n"
0281: + " return rhex(a) + rhex(b) + rhex(c) + rhex(d);\n"
0282: + "}\n"
0283: + "\n"
0284: + "function valid_js() {\n"
0285: + " // anything that claims NS 4 or higher functionality better work \n"
0286: + " if (navigator.userAgent.indexOf(\"Mozilla/\") == 0) {\n"
0287: + " return (parseInt(navigator.appVersion) >= 4);\n"
0288: + " }\n"
0289: + " return false;\n"
0290: + "}\n"
0291: + " \n"
0292: + "function hash(form,login_url) {\n"
0293: + " // this is Javascript enabled browser\n"
0294: + " //document.login_form[\".js\"].value=1;\n"
0295: + " // rudimentary check for a 4.x brower. should catch IE4+ and NS4.*\n"
0296: + " var url;\n"
0297: + "\n"
0298: + " if (arguments.length > 1 && login_url != \"\") { // in case login_url is not passed in\n"
0299: + " url = login_url;\n"
0300: + " } else {\n"
0301: + " url = \"http://login.yahoo.com/config/login\";\n"
0302: + " }\n"
0303: + " url += \"?\";\n"
0304: + " \n"
0305: + " if (valid_js()) {\n"
0306: + " var passwd = form.passwd.value;\n"
0307: + " var hash1 = MD5(form.passwd.value);\n"
0308: + " var challenge = form[\".challenge\"].value;\n"
0309: + " var hash2 = MD5(form.passwd.value) + challenge;\n"
0310: + " var hash;\n"
0311: + " if(form.passwd.value){\n"
0312: + " hash=MD5(hash2);\n"
0313: + " } else {\n"
0314: + " hash=\"\";\n"
0315: + " }\n"
0316: + " var js = 0;\n"
0317: + "\n"
0318: + " for(i=0; i<form.elements.length; i++){\n"
0319: + " if(form.elements[i].name.length <=0) {\n"
0320: + " continue;\n"
0321: + " }\n"
0322: + " if(i > 0){\n"
0323: + " url += \"&\";\n"
0324: + " }\n"
0325: + " url += form.elements[i].name;\n"
0326: + " url += \"=\";\n"
0327: + " if(form.elements[i].name == \"passwd\"){\n"
0328: + " url += hash;\n"
0329: + " } else if (form.elements[i].type == \"checkbox\" && !form.elements[i].checked) {\n"
0330: + " url += \"\";\n"
0331: + " } else if (form.elements[i].type == \"radio\" && !form.elements[i].checked) {\n"
0332: + " url += \"\";\n"
0333: + " } else if (form.elements[i].name == \".save\"){\n"
0334: + " url += \"1\"; // \"Sign in\" causes problem with the space\n"
0335: + " } else if (form.elements[i].name == \".js\"){\n"
0336: + " js = 1;\n"
0337: + " url += \"1\"; \n"
0338: + " } else {\n"
0339: + " url += escape(form.elements[i].value);\n"
0340: + " }\n"
0341: + " }\n"
0342: + " // indicate the password is hashed.\n"
0343: + " url += \"&.hash=1\";\n"
0344: + " if(js == 0){\n"
0345: + " url += \"&.js=1\";\n"
0346: + " }\n"
0347: + " url += \"&.md5=1\";\n"
0348: + " //alert(\"url=\" + url);\n"
0349: + " location.href=url;\n"
0350: + " // prevent from running this again. Allow the server response to submit the form directly\n"
0351: + " form.onsubmit=null;\n"
0352: + "\n"
0353: + " // abort normal form submission\n"
0354: + " return false;\n"
0355: + " }\n"
0356: + " // allow normal form submission\n"
0357: + " return true;\n"
0358: + "}</script>\n"
0359: + "<table bgcolor=#ffffff border=0 cellpadding=0 cellspacing=0 width=680>\n"
0360: + "<tr><td colspan=3>\n"
0361: + "<table border=0 width=100% cellpadding=4 cellspacing=0>\n"
0362: + "<tr><td valign=bottom><table cellspacing=0 cellpadding=0 width=100% border=0>\n"
0363: + " <tr>\n"
0364: + " <td width=1% align=left><img src=\"http://us.i1.yimg.com/us.yimg.com/i/us/pim/b/mailma1.gif\" alt=\"Yahoo! Mail\" border=\"0\" height=\"34\" width=\"250\">\n"
0365: + "\n"
0366: + "</td>\n"
0367: + "\n"
0368: + "<td align=right nowrap valign=bottom><font face=Arial size=-1><a href=\"http://help.yahoo.com/help/us/edit/\">Help</a> - <a href=\"http://www.yahoo.com\">Yahoo!</a></font>\n"
0369: + "</tr></table>\n"
0370: + "\n"
0371: + "</td></tr>\n"
0372: + "<tr><td bgcolor=B6C7E5>"
0373: + "<font size=+1 face=Arial color=black>"
0374: + "<b>Welcome to Yahoo! Mail\n"
0375: + "</b></font>\n"
0376: + "</td></tr></table>\n"
0377: + "</td></tr>\n"
0378: + "<tr><td colspan=3>\n"
0379: + "<table width=100% align=center cellpadding=3 cellspacing=2 border=0><tr><td align=center>\n"
0380: + "<font color=green face=arial><b>\n"
0381: + "You must sign in to read or send mail.\n"
0382: + "</b></font></td></tr></table>\n"
0383: + "</td></tr>\n"
0384: + "<tr><td colspan=3 valign=top>\n"
0385: + "<table border=0 cellspacing=2 cellpadding=0 width=98%>\n"
0386: + "<tr><td width=\"50%\" valign=\"top\">\n"
0387: + " <table border=0 cellpadding=2 cellspacing=0 width=\"100%\">\n"
0388: + " <tr><td align=center>\n"
0389: + "</td></tr></table>\n"
0390: + "\n"
0391: + "<!-- property_promo -->\n"
0392: + "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\n"
0393: + " <tr>\n"
0394: + " <td width=\"400\" valign=\"top\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\">\n"
0395: + " <tr>\n"
0396: + " <td valign=\"top\" bgcolor=\"#859BC1\" width=\"1%\"><img alt=\"Yahoo! Mail\" src=\"http://us.i1.yimg.com/us.yimg.com/i/us/pim/lgn/v4_mail1.jpg\" width=\"125\" height=\"280\"></td>\n"
0397: + " <td valign=\"top\" bgcolor=\"#F2F4F8\" width=\"99%\">\n"
0398: + " <table width=\"100%\" cellpadding=\"4\" cellspacing=\"0\" border=\"0\">\n"
0399: + " <tr>\n"
0400: + " <td>\n"
0401: + " <table cellpadding=\"3\" cellspacing=\"0\" border=\"0\"><tr><td height=\"5\">\n"
0402: + " </td>\n"
0403: + " </tr>\n"
0404: + " <tr> \n"
0405: + " <td></td>\n"
0406: + " <td><font face=\"arial\" color=\"#29416E\" size=\"+1\"><b>New to Yahoo!?</b></font> <br>\n"
0407: + " <b style=\"font-family:Verdana; color: #29416e; font-size:11px;\"><a href=\"http://billing.mail.yahoo.com/bm/MailReg?.done=&.intl=us&.src=ym&.u=42isng8uimube&partner=&.p=&promo=&.last=\">Get Yahoo! Mail</a>, CNET Editors' Choice!</b>\n"
0408: + " </td>\n"
0409: + " </tr>\n"
0410: + " <tr> \n"
0411: + " <td height=\"8\"></td>\n"
0412: + " </tr>\n"
0413: + " <tr>\n"
0414: + " <td valign=\"top\"><img alt=\"bullet gif\" src=\"http://us.i1.yimg.com/us.yimg.com/i/us/pim/lgn/v4_bul1.gif\" width=\"6\" height=\"8\" vspace=\"2\"></td>\n"
0415: + " <td><span style=\"font-family:Verdana; font-size: 11px;\"><b>Free</b> email</span></td>\n"
0416: + " </tr> \n"
0417: + " <tr>\n"
0418: + " <td valign=\"top\"><img alt=\"bullet\" src=\"http://us.i1.yimg.com/us.yimg.com/i/us/pim/lgn/v4_bul1.gif\" width=\"6\" height=\"8\" vspace=\"2\"></td>\n"
0419: + " <td><span style=\"font-family:Verdana; font-size: 11px;\"><b>Free</b> 4MB storage - up to twice as much as other free email providers!</span></td>\n"
0420: + " </tr>\n"
0421: + " <tr>\n"
0422: + " <td valign=\"top\"><img alt=\"bullet\" src=\"http://us.i1.yimg.com/us.yimg.com/i/us/pim/lgn/v4_bul1.gif\" width=\"6\" height=\"8\" vspace=\"2\"></td>\n"
0423: + " <td><span style=\"font-family:Verdana; font-size: 11px;\"><b>Free</b> state-of-the-art spam protection</span></td></tr>\n"
0424: + " <tr>\n"
0425: + " <td valign=\"top\"><img alt=\"\" src=\"http://us.i1.yimg.com/us.yimg.com/i/us/pim/lgn/v4_bul1.gif\" width=\"6\" height=\"8\" vspace=\"2\"></td>\n"
0426: + " <td><span style=\"font-family:Verdana; font-size: 11px;\">Access from virtually anywhere, anytime</span></td></tr>\n"
0427: + " <tr>\n"
0428: + " <td valign=\"top\"><img src=\"http://us.i1.yimg.com/us.yimg.com/i/us/pim/lgn/v4_bul1.gif\" width=\"6\" height=\"8\" vspace=\"2\"></td>\n"
0429: + " <td><span style=\"font-family:Verdana; font-size: 11px;\">Easy access to Yahoo! services like Address Book and Calendar</span></td></tr>\n"
0430: + " <tr> \n"
0431: + " <td height=\"8\"></td></tr>\n"
0432: + " <tr>\n"
0433: + " <td colspan=\"2\" align=\"center\"><b><a href=\"http://billing.mail.yahoo.com/bm/MailReg?.done=&.intl=us&.src=ym&.u=42isng8uimube&partner=&.p=&promo=&.last=\"><font face=\"arial\" size=\"+1\">Sign up now</font></a></b></td></tr>\n"
0434: + " <tr>\n"
0435: + " <td colspan=\"2\" align=\"center\"><a href=\"http://edit.yahoo.com/config/form?.form=ym_signup_more_info&.intl=us&new=1&.done=&.last=&.src=ym&.v=4&.u=0&.partner=\"><font face=\"arial\" size=\"-2\">Learn more...</font></a></td></tr>\n"
0436: + " <tr>\n"
0437: + " <td height=\"8\" colspan=2><div style=\"width:275px;height:2px;\"><spacer type=\"block\" width=275 height=2></div>\n"
0438: + " </td>\n"
0439: + " </tr>\n"
0440: + " </table>\n"
0441: + " </td>\n"
0442: + " </tr>\n"
0443: + " </table>\n"
0444: + " </td>\n"
0445: + " </tr>\n"
0446: + "</table>\n"
0447: + "</td>\n"
0448: + "</tr>\n"
0449: + "</table>\n"
0450: + "<!-- property_promo -->\n"
0451: + "</td>\n"
0452: + "<td width=\"1%\"> </td>\n"
0453: + "<td align=\"left\" valign=\"top\">\n"
0454: + "<form method=post action=\"https://login.yahoo.com/config/login?8nlc5hovs5k61\" autocomplete=off name=login_form onsubmit=\"return hash(this,'http://login.yahoo.com/config/login')\">\n"
0455: + "<table bgcolor=B6C7E5\n"
0456: + "\n"
0457: + "\n"
0458: + " border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"100%\">\n"
0459: + "<tr><td>\n"
0460: + "\n"
0461: + "<table bgcolor=\"#eeeeee\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"100%\"> \n"
0462: + "<tr><td bgcolor=\"#ffffff\" align=\"center\">\n"
0463: + "\n"
0464: + "<table border=\"0\" cellspacing=\"6\" cellpadding=\"6\" bgcolor=\"ffffff\" width=\"100%\">\n"
0465: + "<tr bgcolor=\"eeeeee\">\n"
0466: + "<td align=\"center\"> \n"
0467: + "<font face=\"arial\"><b>Existing\n"
0468: + "Yahoo! users</b></font><br>\n"
0469: + "<font face=\"arial\" size=\"-1\"><nobr> Enter your ID and password to sign in </nobr></font>\n"
0470: + "\n"
0471: + "<table border=\"0\" cellpadding=\"4\" cellspacing=\"0\">\n"
0472: + "<tr> <td align=\"right\">\n"
0473: + "<input type=hidden name=\".tries\" value=\"\" >\n"
0474: + "<input type=hidden name=\".src\" value=\"ym\" >\n"
0475: + "<input type=hidden name=\".md5\" value=\"\" >\n"
0476: + "<input type=hidden name=\".hash\" value=\"\" >\n"
0477: + "<input type=hidden name=\".js\" value=\"\" >\n"
0478: + "<input type=hidden name=\".last\" value=\"\" >\n"
0479: + "<input type=hidden name=\"promo\" value=\"\" >\n"
0480: + "<input type=hidden name=\".intl\" value=\"us\" >\n"
0481: + "<input type=hidden name=\".bypass\" value=\"\" >\n"
0482: + "<input type=hidden name=\".partner\" value=\"\" >\n"
0483: + "<input type=hidden name=\".u\" value=\"b8o6ifouob311\" >\n"
0484: + "<input type=hidden name=\".v\" value=\"0\" >\n"
0485: + "<input type=hidden name=\".challenge\" value=\"C4m7IwmEEAZSNW2pTO6PCra9s68X\">\n"
0486: + "<input type=hidden name=\".emailCode\" value=\"\">\n"
0487: + "<input type=hidden name=\"hasMsgr\" value=0 >\n"
0488: + "<input type=hidden name=\".chkP\" value=\"Y\" >\n"
0489: + "<input type=hidden name=\".done\" value=\"\" >\n"
0490: + "<script language=javascript>\n"
0491: + "<!--\n"
0492: + " browser_string = navigator.appVersion + \" \" + navigator.userAgent;\n"
0493: + " if ( browser_string.indexOf(\"MSIE\") < 0 ) {\n"
0494: + " if (navigator.mimeTypes) {\n"
0495: + " for (i = 0 ; i < navigator.mimeTypes.length ; i++) {\n"
0496: + " if (navigator.mimeTypes[i].suffixes.indexOf(\"yps\") > -1) {\n"
0497: + " doGotIt();\n"
0498: + " }\n"
0499: + " }\n"
0500: + " } else {\n"
0501: + " dontGotIt();\n"
0502: + " }\n"
0503: + " } else {\n"
0504: + " if (browser_string.indexOf(\"Windows\")>=0) {\n"
0505: + " doGotIt();\n"
0506: + " document.write('<object classid=\"clsid:41695A8E-6414-11D4-8FB3-00D0B7730277\" CODEBASE=\"javascript:dontGotIt();\" ID=\"Ymsgr\" width=\"1\" height=\"1\">');\n"
0507: + " document.write('</object>');\n"
0508: + " }\n"
0509: + " }\n"
0510: + "//-->\n"
0511: + "</script>\n"
0512: + "<table border=\"0\" cellpadding=\"2\" cellspacing=\"0\">\n"
0513: + "<tr> <td align=\"right\" nowrap><font face=\"arial\" size=\"-1\">Yahoo! ID:</font></td>\n"
0514: + "<td><input name=\"login\" size=\"17\" value=\"\"></td>\n"
0515: + "</tr>\n"
0516: + "<tr> <td align=\"right\" nowrap><font face=\"arial\" size=\"-1\">Password:</font></td>\n"
0517: + "<td><input name=\"passwd\" type=\"password\" size=\"17\" maxlength=\"32\"></td></tr>\n"
0518: + "<tr> <td colspan=\"2\" nowrap align=\"center\"><font face=\"arial\" size=\"-1\">\n"
0519: + "<input type=\"checkbox\" name=\".persistent\" value=\"y\">Remember my ID on this computer</font></td>\n"
0520: + "</tr><tr>\n"
0521: + "<td> </td>\n"
0522: + "<td><input name=\".save\" type=\"submit\" value=\"Sign In\"></td>\n"
0523: + "</tr>\n"
0524: + "</table> \n"
0525: + "\n"
0526: + "</td></tr>\n"
0527: + "<tr> <td nowrap bgcolor=\"eeeeee\" align=\"center\">\n"
0528: + "<font face=\"arial\" size=\"-1\">Mode:\n"
0529: + "Standard | <a href=\"https://login.yahoo.com/config/login?.src=ym&.v=0&.u=b8o6ifouob311&.last=&promo=&.intl=us&.bypass=&.partner=&.done=\"> Secure</a>\n"
0530: + "</font>\n"
0531: + "</td></tr>\n"
0532: + "</table>\n"
0533: + "\n"
0534: + "</td></tr>\n"
0535: + "<tr bgcolor=\"eeeeee\"><td valign=\"top\" align=\"center\"> <font face=\"arial\" size=\"-1\">\n"
0536: + "<a href=\"http://login.yahoo.com/config/login?.src=ym&.help=1&.v=0&.u=b8o6ifouob311&.last=&promo=&.intl=us&.bypass=&.partner=&.done=\">Sign-in help</a> <a href=\"http://edit.yahoo.com/config/eval_forgot_pw?new=1&.done=&.src=ym&partner=&.intl=us\">Password lookup</a>\n"
0537: + "\n"
0538: + "\n"
0539: + "</font></td></tr>\n"
0540: + "</table>\n"
0541: + "</td></tr></table>\n"
0542: + "</td></tr></table>\n"
0543: + "</form>\n"
0544: + "\n"
0545: + "<!-- premium_promo -->\n"
0546: + "<table bgcolor=#a0b8c8 border=0 cellpadding=2 cellspacing=0 width=100%><tr><td>\n"
0547: + "<table bgcolor=#ffffff border=0 cellpadding=0 cellspacing=0 width=100%><tr><td>\n"
0548: + "<table bgcolor=#ffffff border=0 cellspacing=2 cellpadding=3 width=100%><tr><td align=center>\n"
0549: + "<font face=arial size=-1><b>Get the email address you've always wanted with\n"
0550: + "<a href=\"http://rd.yahoo.com/login/ym/*http://billing.mail.yahoo.com/yo/vorder2?.refer=login\">Personal Address</a></b></font>\n"
0551: + "</td></tr>\n"
0552: + "</table></td></tr>\n"
0553: + "</table></td></tr>\n"
0554: + "</table>\n"
0555: + "<!-- premium_promo -->\n"
0556: + "\n"
0557: + "</td>\n"
0558: + "</tr>\n"
0559: + "<tr><td colspan=4 width=640>\n"
0560: + "<hr width=\"100%\">\n"
0561: + "<table width=\"100%\">\n"
0562: + "<tr><td align=center width=100%>\n"
0563: + "<div align=\"center\">\n"
0564: + "\n"
0565: + "<table border=0 cellspacing=0 cellpadding=2 width=640>\n"
0566: + " <tr>\n"
0567: + " <td align=\"left\" colspan=2><font face=\"Arial\"><b>\n"
0568: + "Yahoo! Mail\n"
0569: + "for International Users</b></font>\n"
0570: + " </td>\n"
0571: + " </tr>\n"
0572: + " <tr>\n"
0573: + " <td valign=top align=right><small><font face=\"Arial\" size=\"-2\"><i>Europe</i> :</font></small></td>\n"
0574: + " <td valign=top><small><font face=\"Arial\" size=\"-2\"><a\n"
0575: + "href=\"http://eur.rd.yahoo.com/login/ym/*http://login.europe.yahoo.com/config/login?.intl=dk&.src=ym&.done=\">Danmark</a> - <a\n"
0576: + "href=\"http://eur.rd.yahoo.com/login/ym/*http://login.europe.yahoo.com/config/login?.intl=de&.src=ym&.done=\">Deutschland</a> - <a \n"
0577: + "href=\"http://eur.rd.yahoo.com/login/ym/*http://login.europe.yahoo.com/config/login?.intl=es&.src=ym&.done=\">España</a> - <a \n"
0578: + "href=\"http://eur.rd.yahoo.com/login/ym/*http://login.europe.yahoo.com/config/login?.intl=fr&.src=ym&.done=\">France</a> - <a \n"
0579: + "href=\"http://eur.rd.yahoo.com/login/ym/*http://login.europe.yahoo.com/config/login?.intl=it&.src=ym&.done=\">Italia</a> - <a\n"
0580: + "href=\"http://eur.rd.yahoo.com/login/ym/*http://login.europe.yahoo.com/config/login?.intl=no&.src=ym&.done=\">Norge</a> - <a\n"
0581: + "href=\"http://eur.rd.yahoo.com/login/ym/*http://login.europe.yahoo.com/config/login?.intl=se&.src=ym&.done=\">Sverige</a> - <a\n"
0582: + "href=\"http://eur.rd.yahoo.com/login/ym/*http://login.europe.yahoo.com/config/login?.intl=uk&.src=ym&.done=\">UK</a>/<a\n"
0583: + "href=\"http://eur.rd.yahoo.com/login/ym/*http://login.europe.yahoo.com/config/login?.intl=ie&.src=ym&.done=\">Ireland</a>\n"
0584: + "</font></small></td>\n"
0585: + " </tr>\n"
0586: + " <tr>\n"
0587: + " <td valign=top align=right><small><font face=\"Arial\" size=\"-2\"><i>Pacific Rim</i>:</font></small></td>\n"
0588: + " <td valign=top><small><font face=\"Arial\" size=\"-2\"><a \n"
0589: + "href=\"http://rd.yahoo.com/login/ym/*http://login.yahoo.com/config/login?.intl=au&.src=ym&.done=\">Australia</a>/<a\n"
0590: + "href=\"http://rd.yahoo.com/login/ym/*http://login.yahoo.com/config/login?.intl=nz&.src=ym&.done=\">NZ</a> - <a\n"
0591: + "href=\"http://rd.yahoo.com/login/ym/*http://login.yahoo.com/config/login?.intl=cn&.src=ym&.done=\">China</a> - <a\n"
0592: + "href=\"http://rd.yahoo.com/login/ym/*http://login.yahoo.com/config/login?.intl=hk&.src=ym&.done=\">Hong Kong</a> - <a\n"
0593: + "href=\"http://rd.yahoo.com/login/ym/*http://login.india.yahoo.com/config/login?.intl=in&.src=ym&.done=\">India</a> - \n"
0594: + "<a\n"
0595: + "href=\"http://rd.yahoo.com/login/ym/*http://edit.my.yahoo.co.jp/config/form?.lg=jp&.intl=jp&.form=main_mail&.src=ym&.done=http%3a//edit.my.yahoo.co.jp/config/mail%3f.intl=jp\">Japan</a> - \n"
0596: + "<a\n"
0597: + "href=\"http://rd.yahoo.com/login/ym/*http://login.korea.yahoo.com/config/login?.intl=kr&.src=ym&.done=\">Korea</a> - <a \n"
0598: + "href=\"http://rd.yahoo.com/login/ym/*http://login.yahoo.com/config/login?.intl=sg&.src=ym&.done=\">Singapore</a> - <a \n"
0599: + "href=\"http://rd.yahoo.com/login/ym/*http://login.yahoo.com/config/login?.intl=tw&.src=ym&.done=\">Taiwan</a></font></small></td>\n"
0600: + " </tr>\n"
0601: + " <tr>\n"
0602: + " <td valign=top align=right><small><font face=\"Arial\" size=\"-2\"><i>Americas</i>:</font></small></td>\n"
0603: + " <td valign=top><small><font face=\"Arial\" size=\"-2\">\n"
0604: + "<a \n"
0605: + "href=\"http://rd.yahoo.com/login/ym/?http://login.yahoo.com/config/login?.intl=ar&.src=ym&.done=\">Argentina</a> - <a\n"
0606: + "href=\"http://rd.yahoo.com/login/ym/?http://login.yahoo.com/config/login?.intl=br&.src=ym&.done=\">Brasil</a> - <a\n"
0607: + "href=\"http://rd.yahoo.com/login/ym/?http://login.yahoo.com/config/login?.intl=ca&.src=ym&.done=\">Canada</a> - <a\n"
0608: + "href=\"http://rd.yahoo.com/login/ym/?http://login.yahoo.com/config/login?.intl=mx&.src=ym&.done=\">Mexico</a> - <a\n"
0609: + "href=\"http://rd.yahoo.com/login/ym/?http://login.yahoo.com/config/login?.intl=b5&.src=ym&.done=\">in Chinese</a> - <a\n"
0610: + "href=\"http://rd.yahoo.com/login/ym/?http://login.yahoo.com/config/login?.intl=e1&.src=ym&.done=\">en Español</a>\n"
0611: + "</font></small></td>\n"
0612: + " </tr>\n"
0613: + "</table></div>\n"
0614: + "</td>\n"
0615: + "<td align=center><a href=\"http://www.cnet.com/software/0-3227888-1204-9973844.html\"><IMG SRC=\"http://us.i1.yimg.com/us.yimg.com/i/us/pim/lgn/cnet_ed3.gif\" alt=\"CNET\" WIDTH=40 HEIGHT=75 BORDER=0></a><!-- SpaceID=55021434 loc=SE noad -->\n"
0616: + "</td>\n"
0617: + "<td align=center><a href=\"http://my.yahoo.com/netapp/?http://www.netapp.com/poweredby.html\"><IMG SRC=\"http://us.i1.yimg.com/us.yimg.com/i/mail/ntap2.gif\" alt=NTAP WIDTH=105 HEIGHT=60 BORDER=0></a></td>\n"
0618: + "</tr></table>\n"
0619: + "</td></tr>\n"
0620: + "</table> \n"
0621: + "</td></tr>\n"
0622: + "<tr><td colspan=3> \n"
0623: + "<table width=100% border=0 cellpadding=0 cellspacing=0>\n"
0624: + "\n"
0625: + "\n"
0626: + "</table>\n"
0627: + "</td></tr>\n"
0628: + "</table> \n"
0629: + "</center>\n"
0630: + "<!-- SpaceID=55021434 loc=Z noad -->\n"
0631: + "\n"
0632: + "<p><center><hr width=\"80%\" size=1 noshade><table border=0 cellpadding=0 cellspacing=0><tr><td align=center valign=bottom width=\"100%\"><font size=-2 face=arial color=#8d8d8d>Copyright © 2002 Yahoo! Inc. All rights reserved. <a href=\"http://docs.yahoo.com/info/terms/\" target=_top>Terms of Service</a><br><b>NOTICE: We collect personal information on this site.<br>To learn more about how we use your information, see our <a href=\"http://privacy.yahoo.com/\" target=_top>Privacy Policy</a></b></font></td></tr></table></center>\n"
0633: + "</body>\n" + "</html>\n";
0634:
0635: String lExpectation = "<html>\n" + "<head>\n"
0636: + JSWrapperHelper.CONVERT_EXPRESSION_FUNCTION_HTML
0637: + "<script language=\"javascript\" src=\"http://us.i1.yimg.com/us.yimg.com/i/mc/mc.js\">\n"
0638: + "</script>\n"
0639: + "<meta http-equiv=\"pics-label\" content='(pics-1.1 \"http://www.icra.org/ratingsv02.html\" l gen true for \"http://mail.yahoo.com\" r ( nz 0 vz 0 lz 0 oz 0 ca 1))'>\n"
0640: + "<title>Yahoo! Mail - The best free web-based email!</title>\n"
0641: + "</head>\n"
0642: + "<body bgcolor=#ffffff\n"
0643: + "onload=\"document.login_form.login.focus();\">\n"
0644: + "<center>\n"
0645: + "<script language=\"JavaScript\">\n"
0646: + "<!--\n"
0647: + "hasMsgr = 0;\n"
0648: + "function dontGotIt(){\n"
0649: + " hasMsgr = 0;\n"
0650: + " document.login_form.hasMsgr.value=0;\n"
0651: + "}\n"
0652: + "\n"
0653: + "function doGotIt(){\n"
0654: + " hasMsgr = 1;\n"
0655: + " document.login_form.hasMsgr.value=1;\n"
0656: + "}\n"
0657: + "//-->\n"
0658: + "</script>\n"
0659: + "\n"
0660: + "<script language=\"javascript\">\n"
0661: + "/*\n"
0662: + " * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n"
0663: + " * Digest Algorithm, as defined in RFC 1321.\n"
0664: + " * Copyright (C) Paul Johnston 1999 - 2000.\n"
0665: + " * Updated by Greg Holt 2000 - 2001.\n"
0666: + " * See http://pajhome.org.uk/site/legal.html for details.\n"
0667: + " */\n"
0668: + "\n"
0669: + "/*\n"
0670: + " * Convert a 32-bit number to a hex string with ls-byte first\n"
0671: + " */\n"
0672: + "var hex_chr = \"0123456789abcdef\";\n"
0673: + "function rhex(num)\n"
0674: + "{\n"
0675: + " str = \"\";\n"
0676: + " for(j = 0; j <= 3; j++)\n"
0677: + " str += hex_chr.charAt((num >> (j * 8 + 4)) & 0x0F) +\n"
0678: + " hex_chr.charAt((num >> (j * 8)) & 0x0F);\n"
0679: + " return str;\n"
0680: + "}\n"
0681: + "\n"
0682: + "/*\n"
0683: + " * Convert a string to a sequence of 16-word blocks, stored as an array.\n"
0684: + " * Append padding bits and the length, as described in the MD5 standard.\n"
0685: + " */\n"
0686: + "function str2blks_MD5(str)\n"
0687: + "{\n"
0688: + " nblk = ((str.length + 8) >> 6) + 1;\n"
0689: + " blks = new Array(nblk * 16);\n"
0690: + " for(i = 0; i < nblk * 16; i++) blks[i] = 0;\n"
0691: + " for(i = 0; i < str.length; i++)\n"
0692: + " blks[i >> 2] |= str.charCodeAt(i) << ((i % 4) * 8);\n"
0693: + " blks[i >> 2] |= 0x80 << ((i % 4) * 8);\n"
0694: + " blks[nblk * 16 - 2] = str.length * 8;\n"
0695: + " return blks;\n"
0696: + "}\n"
0697: + "\n"
0698: + "/*\n"
0699: + " * Add integers, wrapping at 2^32. This uses 16-bit operations internally \n"
0700: + " * to work around bugs in some JS interpreters.\n"
0701: + " */\n"
0702: + "function add(x, y)\n"
0703: + "{\n"
0704: + " var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n"
0705: + " var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n"
0706: + " return (msw << 16) | (lsw & 0xFFFF);\n"
0707: + "}\n"
0708: + "\n"
0709: + "/*\n"
0710: + " * Bitwise rotate a 32-bit number to the left\n"
0711: + " */\n"
0712: + "function rol(num, cnt)\n"
0713: + "{\n"
0714: + " return (num << cnt) | (num >>> (32 - cnt));\n"
0715: + "}\n"
0716: + "\n"
0717: + "/*\n"
0718: + " * These functions implement the basic operation for each round of the\n"
0719: + " * algorithm.\n"
0720: + " */\n"
0721: + "function cmn(q, a, b, x, s, t)\n"
0722: + "{\n"
0723: + " return add(rol(add(add(a, q), add(x, t)), s), b);\n"
0724: + "}\n"
0725: + "function ff(a, b, c, d, x, s, t)\n"
0726: + "{\n"
0727: + " return cmn((b & c) | ((~b) & d), a, b, x, s, t);\n"
0728: + "}\n"
0729: + "function gg(a, b, c, d, x, s, t)\n"
0730: + "{\n"
0731: + " return cmn((b & d) | (c & (~d)), a, b, x, s, t);\n"
0732: + "}\n"
0733: + "function hh(a, b, c, d, x, s, t)\n"
0734: + "{\n"
0735: + " return cmn(b ^ c ^ d, a, b, x, s, t);\n"
0736: + "}\n"
0737: + "function ii(a, b, c, d, x, s, t)\n"
0738: + "{\n"
0739: + " return cmn(c ^ (b | (~d)), a, b, x, s, t);\n"
0740: + "}\n"
0741: + "\n"
0742: + "/*\n"
0743: + " * Take a string and return the hex representation of its MD5.\n"
0744: + " */\n"
0745: + "function MD5(str)\n"
0746: + "{\n"
0747: + " x = str2blks_MD5(str);\n"
0748: + " var a = 1732584193;\n"
0749: + " var b = -271733879;\n"
0750: + " var c = -1732584194;\n"
0751: + " var d = 271733878;\n"
0752: + " \n"
0753: + " for(i = 0; i < x.length; i += 16)\n"
0754: + " {\n"
0755: + " var olda = a;\n"
0756: + " var oldb = b;\n"
0757: + " var oldc = c;\n"
0758: + " var oldd = d;\n"
0759: + "\n"
0760: + " a = ff(a, b, c, d, x[i+ 0], 7 , -680876936);\n"
0761: + " d = ff(d, a, b, c, x[i+ 1], 12, -389564586);\n"
0762: + " c = ff(c, d, a, b, x[i+ 2], 17, 606105819);\n"
0763: + " b = ff(b, c, d, a, x[i+ 3], 22, -1044525330);\n"
0764: + " a = ff(a, b, c, d, x[i+ 4], 7 , -176418897);\n"
0765: + " d = ff(d, a, b, c, x[i+ 5], 12, 1200080426);\n"
0766: + " c = ff(c, d, a, b, x[i+ 6], 17, -1473231341);\n"
0767: + " b = ff(b, c, d, a, x[i+ 7], 22, -45705983);\n"
0768: + " a = ff(a, b, c, d, x[i+ 8], 7 , 1770035416);\n"
0769: + " d = ff(d, a, b, c, x[i+ 9], 12, -1958414417);\n"
0770: + " c = ff(c, d, a, b, x[i+10], 17, -42063);\n"
0771: + " b = ff(b, c, d, a, x[i+11], 22, -1990404162);\n"
0772: + " a = ff(a, b, c, d, x[i+12], 7 , 1804603682);\n"
0773: + " d = ff(d, a, b, c, x[i+13], 12, -40341101);\n"
0774: + " c = ff(c, d, a, b, x[i+14], 17, -1502002290);\n"
0775: + " b = ff(b, c, d, a, x[i+15], 22, 1236535329); \n"
0776: + "\n"
0777: + " a = gg(a, b, c, d, x[i+ 1], 5 , -165796510);\n"
0778: + " d = gg(d, a, b, c, x[i+ 6], 9 , -1069501632);\n"
0779: + " c = gg(c, d, a, b, x[i+11], 14, 643717713);\n"
0780: + " b = gg(b, c, d, a, x[i+ 0], 20, -373897302);\n"
0781: + " a = gg(a, b, c, d, x[i+ 5], 5 , -701558691);\n"
0782: + " d = gg(d, a, b, c, x[i+10], 9 , 38016083);\n"
0783: + " c = gg(c, d, a, b, x[i+15], 14, -660478335);\n"
0784: + " b = gg(b, c, d, a, x[i+ 4], 20, -405537848);\n"
0785: + " a = gg(a, b, c, d, x[i+ 9], 5 , 568446438);\n"
0786: + " d = gg(d, a, b, c, x[i+14], 9 , -1019803690);\n"
0787: + " c = gg(c, d, a, b, x[i+ 3], 14, -187363961);\n"
0788: + " b = gg(b, c, d, a, x[i+ 8], 20, 1163531501);\n"
0789: + " a = gg(a, b, c, d, x[i+13], 5 , -1444681467);\n"
0790: + " d = gg(d, a, b, c, x[i+ 2], 9 , -51403784);\n"
0791: + " c = gg(c, d, a, b, x[i+ 7], 14, 1735328473);\n"
0792: + " b = gg(b, c, d, a, x[i+12], 20, -1926607734);\n"
0793: + " \n"
0794: + " a = hh(a, b, c, d, x[i+ 5], 4 , -378558);\n"
0795: + " d = hh(d, a, b, c, x[i+ 8], 11, -2022574463);\n"
0796: + " c = hh(c, d, a, b, x[i+11], 16, 1839030562);\n"
0797: + " b = hh(b, c, d, a, x[i+14], 23, -35309556);\n"
0798: + " a = hh(a, b, c, d, x[i+ 1], 4 , -1530992060);\n"
0799: + " d = hh(d, a, b, c, x[i+ 4], 11, 1272893353);\n"
0800: + " c = hh(c, d, a, b, x[i+ 7], 16, -155497632);\n"
0801: + " b = hh(b, c, d, a, x[i+10], 23, -1094730640);\n"
0802: + " a = hh(a, b, c, d, x[i+13], 4 , 681279174);\n"
0803: + " d = hh(d, a, b, c, x[i+ 0], 11, -358537222);\n"
0804: + " c = hh(c, d, a, b, x[i+ 3], 16, -722521979);\n"
0805: + " b = hh(b, c, d, a, x[i+ 6], 23, 76029189);\n"
0806: + " a = hh(a, b, c, d, x[i+ 9], 4 , -640364487);\n"
0807: + " d = hh(d, a, b, c, x[i+12], 11, -421815835);\n"
0808: + " c = hh(c, d, a, b, x[i+15], 16, 530742520);\n"
0809: + " b = hh(b, c, d, a, x[i+ 2], 23, -995338651);\n"
0810: + "\n"
0811: + " a = ii(a, b, c, d, x[i+ 0], 6 , -198630844);\n"
0812: + " d = ii(d, a, b, c, x[i+ 7], 10, 1126891415);\n"
0813: + " c = ii(c, d, a, b, x[i+14], 15, -1416354905);\n"
0814: + " b = ii(b, c, d, a, x[i+ 5], 21, -57434055);\n"
0815: + " a = ii(a, b, c, d, x[i+12], 6 , 1700485571);\n"
0816: + " d = ii(d, a, b, c, x[i+ 3], 10, -1894986606);\n"
0817: + " c = ii(c, d, a, b, x[i+10], 15, -1051523);\n"
0818: + " b = ii(b, c, d, a, x[i+ 1], 21, -2054922799);\n"
0819: + " a = ii(a, b, c, d, x[i+ 8], 6 , 1873313359);\n"
0820: + " d = ii(d, a, b, c, x[i+15], 10, -30611744);\n"
0821: + " c = ii(c, d, a, b, x[i+ 6], 15, -1560198380);\n"
0822: + " b = ii(b, c, d, a, x[i+13], 21, 1309151649);\n"
0823: + " a = ii(a, b, c, d, x[i+ 4], 6 , -145523070);\n"
0824: + " d = ii(d, a, b, c, x[i+11], 10, -1120210379);\n"
0825: + " c = ii(c, d, a, b, x[i+ 2], 15, 718787259);\n"
0826: + " b = ii(b, c, d, a, x[i+ 9], 21, -343485551);\n"
0827: + "\n"
0828: + " a = add(a, olda);\n"
0829: + " b = add(b, oldb);\n"
0830: + " c = add(c, oldc);\n"
0831: + " d = add(d, oldd);\n"
0832: + " }\n"
0833: + " return rhex(a) + rhex(b) + rhex(c) + rhex(d);\n"
0834: + "}\n"
0835: + "\n"
0836: + "function valid_js() {\n"
0837: + " // anything that claims NS 4 or higher functionality better work \n"
0838: + " if (navigator.userAgent.indexOf(\"Mozilla/\") == 0) {\n"
0839: + " return (parseInt(navigator.appVersion) >= 4);\n"
0840: + " }\n"
0841: + " return false;\n"
0842: + "}\n"
0843: + " \n"
0844: + "function hash(form,login_url) {\n"
0845: + " // this is Javascript enabled browser\n"
0846: + " //document.login_form[\".js\"].value=1;\n"
0847: + " // rudimentary check for a 4.x brower. should catch IE4+ and NS4.*\n"
0848: + " var url;\n"
0849: + "\n"
0850: + " if (arguments.length > 1 && login_url != \"\") { // in case login_url is not passed in\n"
0851: + " url = login_url;\n"
0852: + " } else {\n"
0853: + " url = \"http://login.yahoo.com/config/login\";\n"
0854: + " }\n"
0855: + " url += \"?\";\n"
0856: + " \n"
0857: + " if (valid_js()) {\n"
0858: + " var passwd = form.passwd.value;\n"
0859: + " var hash1 = MD5(form.passwd.value);\n"
0860: + " var challenge = form[\".challenge\"].value;\n"
0861: + " var hash2 = MD5(form.passwd.value) + challenge;\n"
0862: + " var hash;\n"
0863: + " if(form.passwd.value){\n"
0864: + " hash=MD5(hash2);\n"
0865: + " } else {\n"
0866: + " hash=\"\";\n"
0867: + " }\n"
0868: + " var js = 0;\n"
0869: + "\n"
0870: + " for(i=0; i<form.elements.length; i++){\n"
0871: + " if(form.elements[i].name.length <=0) {\n"
0872: + " continue;\n"
0873: + " }\n"
0874: + " if(i > 0){\n"
0875: + " url += \"&\";\n"
0876: + " }\n"
0877: + " url += form.elements[i].name;\n"
0878: + " url += \"=\";\n"
0879: + " if(form.elements[i].name == \"passwd\"){\n"
0880: + " url += hash;\n"
0881: + " } else if (form.elements[i].type == \"checkbox\" && !form.elements[i].checked) {\n"
0882: + " url += \"\";\n"
0883: + " } else if (form.elements[i].type == \"radio\" && !form.elements[i].checked) {\n"
0884: + " url += \"\";\n"
0885: + " } else if (form.elements[i].name == \".save\"){\n"
0886: + " url += \"1\"; // \"Sign in\" causes problem with the space\n"
0887: + " } else if (form.elements[i].name == \".js\"){\n"
0888: + " js = 1;\n"
0889: + " url += \"1\"; \n"
0890: + " } else {\n"
0891: + " url += escape(form.elements[i].value);\n"
0892: + " }\n"
0893: + " }\n"
0894: + " // indicate the password is hashed.\n"
0895: + " url += \"&.hash=1\";\n"
0896: + " if(js == 0){\n"
0897: + " url += \"&.js=1\";\n"
0898: + " }\n"
0899: + " url += \"&.md5=1\";\n"
0900: + " //alert(\"url=\" + url);\n"
0901: + " location.href="
0902: + JSWrapperHelper.CONVERT_EXPRESSION_FUNCTION_WRAP_START
0903: + "url);\n"
0904: + " // prevent from running this again. Allow the server response to submit the form directly\n"
0905: + " form.onsubmit=null;\n"
0906: + "\n"
0907: + " // abort normal form submission\n"
0908: + " return false;\n"
0909: + " }\n"
0910: + " // allow normal form submission\n"
0911: + " return true;\n"
0912: + "}</script>\n"
0913: + "<table bgcolor=#ffffff border=0 cellpadding=0 cellspacing=0 width=680>\n"
0914: + "<tr><td colspan=3>\n"
0915: + "<table border=0 width=100% cellpadding=4 cellspacing=0>\n"
0916: + "<tr><td valign=bottom><table cellspacing=0 cellpadding=0 width=100% border=0>\n"
0917: + " <tr>\n"
0918: + " <td width=1% align=left><img src=\"http://us.i1.yimg.com/us.yimg.com/i/us/pim/b/mailma1.gif\" alt=\"Yahoo! Mail\" border=\"0\" height=\"34\" width=\"250\">\n"
0919: + "\n"
0920: + "</td>\n"
0921: + "\n"
0922: + "<td align=right nowrap valign=bottom><font face=Arial size=-1><a href=\"http://help.yahoo.com/help/us/edit/\">Help</a> - <a href=\"http://www.yahoo.com\">Yahoo!</a></font>\n"
0923: + "</tr></table>\n"
0924: + "\n"
0925: + "</td></tr>\n"
0926: + "<tr><td bgcolor=B6C7E5>"
0927: + "<font size=+1 face=Arial color=black>"
0928: + "<b>Welcome to Yahoo! Mail\n"
0929: + "</b></font>\n"
0930: + "</td></tr></table>\n"
0931: + "</td></tr>\n"
0932: + "<tr><td colspan=3>\n"
0933: + "<table width=100% align=center cellpadding=3 cellspacing=2 border=0><tr><td align=center>\n"
0934: + "<font color=green face=arial><b>\n"
0935: + "You must sign in to read or send mail.\n"
0936: + "</b></font></td></tr></table>\n"
0937: + "</td></tr>\n"
0938: + "<tr><td colspan=3 valign=top>\n"
0939: + "<table border=0 cellspacing=2 cellpadding=0 width=98%>\n"
0940: + "<tr><td width=\"50%\" valign=\"top\">\n"
0941: + " <table border=0 cellpadding=2 cellspacing=0 width=\"100%\">\n"
0942: + " <tr><td align=center>\n"
0943: + "</td></tr></table>\n"
0944: + "\n"
0945: + "<!-- property_promo -->\n"
0946: + "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\n"
0947: + " <tr>\n"
0948: + " <td width=\"400\" valign=\"top\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\">\n"
0949: + " <tr>\n"
0950: + " <td valign=\"top\" bgcolor=\"#859BC1\" width=\"1%\"><img alt=\"Yahoo! Mail\" src=\"http://us.i1.yimg.com/us.yimg.com/i/us/pim/lgn/v4_mail1.jpg\" width=\"125\" height=\"280\"></td>\n"
0951: + " <td valign=\"top\" bgcolor=\"#F2F4F8\" width=\"99%\">\n"
0952: + " <table width=\"100%\" cellpadding=\"4\" cellspacing=\"0\" border=\"0\">\n"
0953: + " <tr>\n"
0954: + " <td>\n"
0955: + " <table cellpadding=\"3\" cellspacing=\"0\" border=\"0\"><tr><td height=\"5\">\n"
0956: + " </td>\n"
0957: + " </tr>\n"
0958: + " <tr> \n"
0959: + " <td></td>\n"
0960: + " <td><font face=\"arial\" color=\"#29416E\" size=\"+1\"><b>New to Yahoo!?</b></font> <br>\n"
0961: + " <b style=\"font-family:Verdana; color: #29416e; font-size:11px;\"><a href=\"http://billing.mail.yahoo.com/bm/MailReg?.done=&.intl=us&.src=ym&.u=42isng8uimube&partner=&.p=&promo=&.last=\">Get Yahoo! Mail</a>, CNET Editors' Choice!</b>\n"
0962: + " </td>\n"
0963: + " </tr>\n"
0964: + " <tr> \n"
0965: + " <td height=\"8\"></td>\n"
0966: + " </tr>\n"
0967: + " <tr>\n"
0968: + " <td valign=\"top\"><img alt=\"bullet gif\" src=\"http://us.i1.yimg.com/us.yimg.com/i/us/pim/lgn/v4_bul1.gif\" width=\"6\" height=\"8\" vspace=\"2\"></td>\n"
0969: + " <td><span style=\"font-family:Verdana; font-size: 11px;\"><b>Free</b> email</span></td>\n"
0970: + " </tr> \n"
0971: + " <tr>\n"
0972: + " <td valign=\"top\"><img alt=\"bullet\" src=\"http://us.i1.yimg.com/us.yimg.com/i/us/pim/lgn/v4_bul1.gif\" width=\"6\" height=\"8\" vspace=\"2\"></td>\n"
0973: + " <td><span style=\"font-family:Verdana; font-size: 11px;\"><b>Free</b> 4MB storage - up to twice as much as other free email providers!</span></td>\n"
0974: + " </tr>\n"
0975: + " <tr>\n"
0976: + " <td valign=\"top\"><img alt=\"bullet\" src=\"http://us.i1.yimg.com/us.yimg.com/i/us/pim/lgn/v4_bul1.gif\" width=\"6\" height=\"8\" vspace=\"2\"></td>\n"
0977: + " <td><span style=\"font-family:Verdana; font-size: 11px;\"><b>Free</b> state-of-the-art spam protection</span></td></tr>\n"
0978: + " <tr>\n"
0979: + " <td valign=\"top\"><img alt=\"\" src=\"http://us.i1.yimg.com/us.yimg.com/i/us/pim/lgn/v4_bul1.gif\" width=\"6\" height=\"8\" vspace=\"2\"></td>\n"
0980: + " <td><span style=\"font-family:Verdana; font-size: 11px;\">Access from virtually anywhere, anytime</span></td></tr>\n"
0981: + " <tr>\n"
0982: + " <td valign=\"top\"><img src=\"http://us.i1.yimg.com/us.yimg.com/i/us/pim/lgn/v4_bul1.gif\" width=\"6\" height=\"8\" vspace=\"2\"></td>\n"
0983: + " <td><span style=\"font-family:Verdana; font-size: 11px;\">Easy access to Yahoo! services like Address Book and Calendar</span></td></tr>\n"
0984: + " <tr> \n"
0985: + " <td height=\"8\"></td></tr>\n"
0986: + " <tr>\n"
0987: + " <td colspan=\"2\" align=\"center\"><b><a href=\"http://billing.mail.yahoo.com/bm/MailReg?.done=&.intl=us&.src=ym&.u=42isng8uimube&partner=&.p=&promo=&.last=\"><font face=\"arial\" size=\"+1\">Sign up now</font></a></b></td></tr>\n"
0988: + " <tr>\n"
0989: + " <td colspan=\"2\" align=\"center\"><a href=\"http://edit.yahoo.com/config/form?.form=ym_signup_more_info&.intl=us&new=1&.done=&.last=&.src=ym&.v=4&.u=0&.partner=\"><font face=\"arial\" size=\"-2\">Learn more...</font></a></td></tr>\n"
0990: + " <tr>\n"
0991: + " <td height=\"8\" colspan=2><div style=\"width:275px;height:2px;\"><spacer type=\"block\" width=275 height=2></div>\n"
0992: + " </td>\n"
0993: + " </tr>\n"
0994: + " </table>\n"
0995: + " </td>\n"
0996: + " </tr>\n"
0997: + " </table>\n"
0998: + " </td>\n"
0999: + " </tr>\n"
1000: + "</table>\n"
1001: + "</td>\n"
1002: + "</tr>\n"
1003: + "</table>\n"
1004: + "<!-- property_promo -->\n"
1005: + "</td>\n"
1006: + "<td width=\"1%\"> </td>\n"
1007: + "<td align=\"left\" valign=\"top\">\n"
1008: + "<form method=post action=\"https://login.yahoo.com/config/login?8nlc5hovs5k61\" autocomplete=off name=login_form onsubmit=\"return hash(this,'http://login.yahoo.com/config/login')\">\n"
1009: + "<table bgcolor=B6C7E5\n"
1010: + "\n"
1011: + "\n"
1012: + " border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"100%\">\n"
1013: + "<tr><td>\n"
1014: + "\n"
1015: + "<table bgcolor=\"#eeeeee\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"100%\"> \n"
1016: + "<tr><td bgcolor=\"#ffffff\" align=\"center\">\n"
1017: + "\n"
1018: + "<table border=\"0\" cellspacing=\"6\" cellpadding=\"6\" bgcolor=\"ffffff\" width=\"100%\">\n"
1019: + "<tr bgcolor=\"eeeeee\">\n"
1020: + "<td align=\"center\"> \n"
1021: + "<font face=\"arial\"><b>Existing\n"
1022: + "Yahoo! users</b></font><br>\n"
1023: + "<font face=\"arial\" size=\"-1\"><nobr> Enter your ID and password to sign in </nobr></font>\n"
1024: + "\n"
1025: + "<table border=\"0\" cellpadding=\"4\" cellspacing=\"0\">\n"
1026: + "<tr> <td align=\"right\">\n"
1027: + "<input type=hidden name=\".tries\" value=\"\" >\n"
1028: + "<input type=hidden name=\".src\" value=\"ym\" >\n"
1029: + "<input type=hidden name=\".md5\" value=\"\" >\n"
1030: + "<input type=hidden name=\".hash\" value=\"\" >\n"
1031: + "<input type=hidden name=\".js\" value=\"\" >\n"
1032: + "<input type=hidden name=\".last\" value=\"\" >\n"
1033: + "<input type=hidden name=\"promo\" value=\"\" >\n"
1034: + "<input type=hidden name=\".intl\" value=\"us\" >\n"
1035: + "<input type=hidden name=\".bypass\" value=\"\" >\n"
1036: + "<input type=hidden name=\".partner\" value=\"\" >\n"
1037: + "<input type=hidden name=\".u\" value=\"b8o6ifouob311\" >\n"
1038: + "<input type=hidden name=\".v\" value=\"0\" >\n"
1039: + "<input type=hidden name=\".challenge\" value=\"C4m7IwmEEAZSNW2pTO6PCra9s68X\">\n"
1040: + "<input type=hidden name=\".emailCode\" value=\"\">\n"
1041: + "<input type=hidden name=\"hasMsgr\" value=0 >\n"
1042: + "<input type=hidden name=\".chkP\" value=\"Y\" >\n"
1043: + "<input type=hidden name=\".done\" value=\"\" >\n"
1044: + "<script language=javascript>\n"
1045: + "<!--\n"
1046: + " browser_string = navigator.appVersion + \" \" + navigator.userAgent;\n"
1047: + " if ( browser_string.indexOf(\"MSIE\") < 0 ) {\n"
1048: + " if (navigator.mimeTypes) {\n"
1049: + " for (i = 0 ; i < navigator.mimeTypes.length ; i++) {\n"
1050: + " if (navigator.mimeTypes[i].suffixes.indexOf(\"yps\") > -1) {\n"
1051: + " doGotIt();\n"
1052: + " }\n"
1053: + " }\n"
1054: + " } else {\n"
1055: + " dontGotIt();\n"
1056: + " }\n"
1057: + " } else {\n"
1058: + " if (browser_string.indexOf(\"Windows\")>=0) {\n"
1059: + " doGotIt();\n"
1060: + " document.write('"
1061: + "<object classid=\"clsid:41695A8E-6414-11D4-8FB3-00D0B7730277\" CODEBASE=\"javascript:"
1062: + JSWrapperHelper.CONVERT_EXPRESSION_FUNCTION_WRAP_START
1063: + "dontGotIt());\" ID=\"Ymsgr\" width=\"1\" height=\"1\">');\n"
1064: + " document.write('</object>');\n"
1065: + " }\n"
1066: + " }\n"
1067: + "//-->\n"
1068: + "</script>\n"
1069: + "<table border=\"0\" cellpadding=\"2\" cellspacing=\"0\">\n"
1070: + "<tr> <td align=\"right\" nowrap><font face=\"arial\" size=\"-1\">Yahoo! ID:</font></td>\n"
1071: + "<td><input name=\"login\" size=\"17\" value=\"\"></td>\n"
1072: + "</tr>\n"
1073: + "<tr> <td align=\"right\" nowrap><font face=\"arial\" size=\"-1\">Password:</font></td>\n"
1074: + "<td><input name=\"passwd\" type=\"password\" size=\"17\" maxlength=\"32\"></td></tr>\n"
1075: + "<tr> <td colspan=\"2\" nowrap align=\"center\"><font face=\"arial\" size=\"-1\">\n"
1076: + "<input type=\"checkbox\" name=\".persistent\" value=\"y\">Remember my ID on this computer</font></td>\n"
1077: + "</tr><tr>\n"
1078: + "<td> </td>\n"
1079: + "<td><input name=\".save\" type=\"submit\" value=\"Sign In\"></td>\n"
1080: + "</tr>\n"
1081: + "</table> \n"
1082: + "\n"
1083: + "</td></tr>\n"
1084: + "<tr> <td nowrap bgcolor=\"eeeeee\" align=\"center\">\n"
1085: + "<font face=\"arial\" size=\"-1\">Mode:\n"
1086: + "Standard | <a href=\"https://login.yahoo.com/config/login?.src=ym&.v=0&.u=b8o6ifouob311&.last=&promo=&.intl=us&.bypass=&.partner=&.done=\"> Secure</a>\n"
1087: + "</font>\n"
1088: + "</td></tr>\n"
1089: + "</table>\n"
1090: + "\n"
1091: + "</td></tr>\n"
1092: + "<tr bgcolor=\"eeeeee\"><td valign=\"top\" align=\"center\"> <font face=\"arial\" size=\"-1\">\n"
1093: + "<a href=\"http://login.yahoo.com/config/login?.src=ym&.help=1&.v=0&.u=b8o6ifouob311&.last=&promo=&.intl=us&.bypass=&.partner=&.done=\">Sign-in help</a> <a href=\"http://edit.yahoo.com/config/eval_forgot_pw?new=1&.done=&.src=ym&partner=&.intl=us\">Password lookup</a>\n"
1094: + "\n"
1095: + "\n"
1096: + "</font></td></tr>\n"
1097: + "</table>\n"
1098: + "</td></tr></table>\n"
1099: + "</td></tr></table>\n"
1100: + "</form>\n"
1101: + "\n"
1102: + "<!-- premium_promo -->\n"
1103: + "<table bgcolor=#a0b8c8 border=0 cellpadding=2 cellspacing=0 width=100%><tr><td>\n"
1104: + "<table bgcolor=#ffffff border=0 cellpadding=0 cellspacing=0 width=100%><tr><td>\n"
1105: + "<table bgcolor=#ffffff border=0 cellspacing=2 cellpadding=3 width=100%><tr><td align=center>\n"
1106: + "<font face=arial size=-1><b>Get the email address you've always wanted with\n"
1107: + "<a href=\"http://rd.yahoo.com/login/ym/*http://billing.mail.yahoo.com/yo/vorder2?.refer=login\">Personal Address</a></b></font>\n"
1108: + "</td></tr>\n"
1109: + "</table></td></tr>\n"
1110: + "</table></td></tr>\n"
1111: + "</table>\n"
1112: + "<!-- premium_promo -->\n"
1113: + "\n"
1114: + "</td>\n"
1115: + "</tr>\n"
1116: + "<tr><td colspan=4 width=640>\n"
1117: + "<hr width=\"100%\">\n"
1118: + "<table width=\"100%\">\n"
1119: + "<tr><td align=center width=100%>\n"
1120: + "<div align=\"center\">\n"
1121: + "\n"
1122: + "<table border=0 cellspacing=0 cellpadding=2 width=640>\n"
1123: + " <tr>\n"
1124: + " <td align=\"left\" colspan=2><font face=\"Arial\"><b>\n"
1125: + "Yahoo! Mail\n"
1126: + "for International Users</b></font>\n"
1127: + " </td>\n"
1128: + " </tr>\n"
1129: + " <tr>\n"
1130: + " <td valign=top align=right><small><font face=\"Arial\" size=\"-2\"><i>Europe</i> :</font></small></td>\n"
1131: + " <td valign=top><small><font face=\"Arial\" size=\"-2\"><a\n"
1132: + "href=\"http://eur.rd.yahoo.com/login/ym/*http://login.europe.yahoo.com/config/login?.intl=dk&.src=ym&.done=\">Danmark</a> - <a\n"
1133: + "href=\"http://eur.rd.yahoo.com/login/ym/*http://login.europe.yahoo.com/config/login?.intl=de&.src=ym&.done=\">Deutschland</a> - <a \n"
1134: + "href=\"http://eur.rd.yahoo.com/login/ym/*http://login.europe.yahoo.com/config/login?.intl=es&.src=ym&.done=\">España</a> - <a \n"
1135: + "href=\"http://eur.rd.yahoo.com/login/ym/*http://login.europe.yahoo.com/config/login?.intl=fr&.src=ym&.done=\">France</a> - <a \n"
1136: + "href=\"http://eur.rd.yahoo.com/login/ym/*http://login.europe.yahoo.com/config/login?.intl=it&.src=ym&.done=\">Italia</a> - <a\n"
1137: + "href=\"http://eur.rd.yahoo.com/login/ym/*http://login.europe.yahoo.com/config/login?.intl=no&.src=ym&.done=\">Norge</a> - <a\n"
1138: + "href=\"http://eur.rd.yahoo.com/login/ym/*http://login.europe.yahoo.com/config/login?.intl=se&.src=ym&.done=\">Sverige</a> - <a\n"
1139: + "href=\"http://eur.rd.yahoo.com/login/ym/*http://login.europe.yahoo.com/config/login?.intl=uk&.src=ym&.done=\">UK</a>/<a\n"
1140: + "href=\"http://eur.rd.yahoo.com/login/ym/*http://login.europe.yahoo.com/config/login?.intl=ie&.src=ym&.done=\">Ireland</a>\n"
1141: + "</font></small></td>\n"
1142: + " </tr>\n"
1143: + " <tr>\n"
1144: + " <td valign=top align=right><small><font face=\"Arial\" size=\"-2\"><i>Pacific Rim</i>:</font></small></td>\n"
1145: + " <td valign=top><small><font face=\"Arial\" size=\"-2\"><a \n"
1146: + "href=\"http://rd.yahoo.com/login/ym/*http://login.yahoo.com/config/login?.intl=au&.src=ym&.done=\">Australia</a>/<a\n"
1147: + "href=\"http://rd.yahoo.com/login/ym/*http://login.yahoo.com/config/login?.intl=nz&.src=ym&.done=\">NZ</a> - <a\n"
1148: + "href=\"http://rd.yahoo.com/login/ym/*http://login.yahoo.com/config/login?.intl=cn&.src=ym&.done=\">China</a> - <a\n"
1149: + "href=\"http://rd.yahoo.com/login/ym/*http://login.yahoo.com/config/login?.intl=hk&.src=ym&.done=\">Hong Kong</a> - <a\n"
1150: + "href=\"http://rd.yahoo.com/login/ym/*http://login.india.yahoo.com/config/login?.intl=in&.src=ym&.done=\">India</a> - \n"
1151: + "<a\n"
1152: + "href=\"http://rd.yahoo.com/login/ym/*http://edit.my.yahoo.co.jp/config/form?.lg=jp&.intl=jp&.form=main_mail&.src=ym&.done=http%3a//edit.my.yahoo.co.jp/config/mail%3f.intl=jp\">Japan</a> - \n"
1153: + "<a\n"
1154: + "href=\"http://rd.yahoo.com/login/ym/*http://login.korea.yahoo.com/config/login?.intl=kr&.src=ym&.done=\">Korea</a> - <a \n"
1155: + "href=\"http://rd.yahoo.com/login/ym/*http://login.yahoo.com/config/login?.intl=sg&.src=ym&.done=\">Singapore</a> - <a \n"
1156: + "href=\"http://rd.yahoo.com/login/ym/*http://login.yahoo.com/config/login?.intl=tw&.src=ym&.done=\">Taiwan</a></font></small></td>\n"
1157: + " </tr>\n"
1158: + " <tr>\n"
1159: + " <td valign=top align=right><small><font face=\"Arial\" size=\"-2\"><i>Americas</i>:</font></small></td>\n"
1160: + " <td valign=top><small><font face=\"Arial\" size=\"-2\">\n"
1161: + "<a \n"
1162: + "href=\"http://rd.yahoo.com/login/ym/?http://login.yahoo.com/config/login?.intl=ar&.src=ym&.done=\">Argentina</a> - <a\n"
1163: + "href=\"http://rd.yahoo.com/login/ym/?http://login.yahoo.com/config/login?.intl=br&.src=ym&.done=\">Brasil</a> - <a\n"
1164: + "href=\"http://rd.yahoo.com/login/ym/?http://login.yahoo.com/config/login?.intl=ca&.src=ym&.done=\">Canada</a> - <a\n"
1165: + "href=\"http://rd.yahoo.com/login/ym/?http://login.yahoo.com/config/login?.intl=mx&.src=ym&.done=\">Mexico</a> - <a\n"
1166: + "href=\"http://rd.yahoo.com/login/ym/?http://login.yahoo.com/config/login?.intl=b5&.src=ym&.done=\">in Chinese</a> - <a\n"
1167: + "href=\"http://rd.yahoo.com/login/ym/?http://login.yahoo.com/config/login?.intl=e1&.src=ym&.done=\">en Español</a>\n"
1168: + "</font></small></td>\n"
1169: + " </tr>\n"
1170: + "</table></div>\n"
1171: + "</td>\n"
1172: + "<td align=center><a href=\"http://www.cnet.com/software/0-3227888-1204-9973844.html\"><IMG SRC=\"http://us.i1.yimg.com/us.yimg.com/i/us/pim/lgn/cnet_ed3.gif\" alt=\"CNET\" WIDTH=40 HEIGHT=75 BORDER=0></a><!-- SpaceID=55021434 loc=SE noad -->\n"
1173: + "</td>\n"
1174: + "<td align=center><a href=\"http://my.yahoo.com/netapp/?http://www.netapp.com/poweredby.html\"><IMG SRC=\"http://us.i1.yimg.com/us.yimg.com/i/mail/ntap2.gif\" alt=NTAP WIDTH=105 HEIGHT=60 BORDER=0></a></td>\n"
1175: + "</tr></table>\n"
1176: + "</td></tr>\n"
1177: + "</table> \n"
1178: + "</td></tr>\n"
1179: + "<tr><td colspan=3> \n"
1180: + "<table width=100% border=0 cellpadding=0 cellspacing=0>\n"
1181: + "\n"
1182: + "\n"
1183: + "</table>\n"
1184: + "</td></tr>\n"
1185: + "</table> \n"
1186: + "</center>\n"
1187: + "<!-- SpaceID=55021434 loc=Z noad -->\n"
1188: + "\n"
1189: + "<p><center><hr width=\"80%\" size=1 noshade><table border=0 cellpadding=0 cellspacing=0><tr><td align=center valign=bottom width=\"100%\"><font size=-2 face=arial color=#8d8d8d>Copyright © 2002 Yahoo! Inc. All rights reserved. <a href=\"http://docs.yahoo.com/info/terms/\" target=_top>Terms of Service</a><br><b>NOTICE: We collect personal information on this site.<br>To learn more about how we use your information, see our <a href=\"http://privacy.yahoo.com/\" target=_top>Privacy Policy</a></b></font></td></tr></table></center>\n"
1190: + "</body>\n" + "</html>\n";
1191:
1192: String lAttRule = "<Attribute name=\"code*se\"/>";
1193:
1194: String lAppletRule = "<Applet source=\"\" code=\"clsid:41695A8E-6414-11D4-8FB3-00D0B7730277\" param=\"functionsURL\"/>";
1195:
1196: String lJSVarRules = "<Variable name=\"*location.href\" type=\"EXPRESSION\"/>";
1197: String lJSFunRule = "<Function type=\"DHTML\" name=\"document.write\" paramPatterns=\"y\"/>";
1198:
1199: RuleSet lRuleSet = CreateRuleSet
1200: .withHTMLAppletAttJSVarJSFunRules(lAppletRule,
1201: lAttRule, lJSVarRules, lJSFunRule);
1202: Rewriter lRewriter = RewriterPool.create(lRuleSet,
1203: LanguageConstants.HTML_MIME);
1204: String lResult = lRewriter.rewrite(lInput,
1205: getDefaultTranslator());
1206: assertEquals(lExpectation, lResult);
1207: }//testBugNo4747776YahooMailPage()
1208:
1209: public void testCalenderBug() throws Exception {
1210: String lInput = "<html>\n"
1211: + "<body>\n"
1212: + "<a href=\"/begin.html\"/>\n"
1213: + "<a href=\"javascript:var x=window.open('/first.shtml?view=new_cal&id=bl02oe8w2rbhp3t6&crc=2561871368&date=20020925T180701&newCalCalID=tuser&tzid=&freebusy=1&tab=1&prevView=monthview&calid=tuser&security=1','','height=550,width=650');\" onmouseover=\"window.status='Edit tuser';return true;\" alt=\"Edit tuser\">Edit</a>\n"
1214: + "<a href=\"javascript:var x=window.open('/second.shtml?view=new_group&id=bl02oe8w2rbhp3t6&crc=2561871368&date=20020925T180701&group_index=0&tab=1&prevView=calendars&calid=tuser&security=1','Edit','height=550,width=650');\">Edit</a>\n"
1215: + "<a href=\"/end.html\"/>\n" + "</body>\n"
1216: + "</html>\n";
1217:
1218: String lExpectation = "<html>\n"
1219: + "<body>\n"
1220: + "<a href=\"http://rajanagendra.sun.com/begin.html\"/>\n"
1221: + "<a href=\"javascript:var x=window.open('http://rajanagendra.sun.com/first.shtml?view=new_cal&id=bl02oe8w2rbhp3t6&crc=2561871368&date=20020925T180701&newCalCalID=tuser&tzid=&freebusy=1&tab=1&prevView=monthview&calid=tuser&security=1','','height=550,width=650');\" onmouseover=\"window.status='Edit tuser';return true;\" alt=\"Edit tuser\">Edit</a>\n"
1222: + "<a href=\"javascript:var x=window.open('http://rajanagendra.sun.com/second.shtml?view=new_group&id=bl02oe8w2rbhp3t6&crc=2561871368&date=20020925T180701&group_index=0&tab=1&prevView=calendars&calid=tuser&security=1','Edit','height=550,width=650');\">Edit</a>\n"
1223: + "<a href=\"http://rajanagendra.sun.com/end.html\"/>\n"
1224: + "</body>\n" + "</html>\n";
1225:
1226: String lAttRule = "<Attribute name=\"href\"/>";
1227: String lJSFunRule = "<Function type=\"EXPRESSION\" name=\"window.open\" paramPatterns=\"y\"/>";
1228:
1229: RuleSet lRuleSet = CreateRuleSet.withHTMLAttJSVarJSFunRules(
1230: lAttRule, "", lJSFunRule);
1231: Rewriter lRewriter = RewriterPool.create(lRuleSet,
1232: LanguageConstants.HTML_MIME);
1233: String lResult = lRewriter.rewrite(lInput,
1234: getDefaultTranslator());
1235: assertEquals(lExpectation, lResult);
1236: }//testCalenderBug()
1237:
1238: public void testEntityRelationShipBug() throws Exception {
1239: String lInput = " location.href=url;\n";
1240: String lExpectation = " location.href="
1241: + JSWrapperHelper.CONVERT_EXPRESSION_FUNCTION_WRAP_START
1242: + "url);\n"
1243: + JSWrapperHelper.CONVERT_EXPRESSION_FUNCTION_JS;
1244:
1245: String lJSVarRules = "<Variable name=\"*location.href\" type=\"EXPRESSION\"/>";
1246: String lJSFunRule = "<Function type=\"DHTML\" name=\"document.write\" paramPatterns=\"y\"/>";
1247:
1248: RuleSet lRuleSet = CreateRuleSet
1249: .withHTMLAppletAttJSVarJSFunRules("", "", lJSVarRules,
1250: lJSFunRule);
1251: Rewriter lRewriter = RewriterPool.create(lRuleSet,
1252: LanguageConstants.JS_MIME);
1253: String lResult = lRewriter.rewrite(lInput,
1254: getDefaultJSTranslator());
1255: assertEquals(lExpectation, lResult);
1256: }//testEntityRelationShipBug()
1257:
1258: public void testBugNo4795370GoTOKeyWordInVariables()
1259: throws Exception {
1260: String lInput = "<script language=\"JavaScript\">\n"
1261: + " window.theForm1.action = 'testPage.html'; // rewriting OK\n"
1262: + " var goto = \"rarara\";\n"
1263: + " window.theForm2.action = 'testPage.html'; // Rewriting fails\n"
1264: + "</script>\n";
1265:
1266: String lExpectation = "<script language=\"JavaScript\">\n"
1267: + " window.theForm1.action = 'http://rajanagendra.sun.com/Base/Raja/testPage.html'; // rewriting OK\n"
1268: + " var goto = \"rarara\";\n"
1269: + " window.theForm2.action = 'http://rajanagendra.sun.com/Base/Raja/testPage.html'; // Rewriting fails\n"
1270: + "</script>\n";
1271:
1272: String lJSVarRules = "<Variable name=\"*action\" type=\"EXPRESSION\"/>";
1273:
1274: RuleSet lRuleSet = CreateRuleSet
1275: .withJSVariableRules(lJSVarRules);
1276: Rewriter lRewriter = RewriterPool.create(lRuleSet,
1277: LanguageConstants.HTML_MIME);
1278: String lResult = lRewriter.rewrite(lInput,
1279: getDefaultTranslator());
1280: assertEquals(lExpectation, lResult);
1281: }//testGoTOKeyWordInVariables()
1282:
1283: public void testBugNo4795370GoTOKeyWordInFunctions()
1284: throws Exception {
1285: String lInput = "<script language=\"JavaScript\">\n"
1286: + " window.theForm1.action = 'testPage.html'; //rewriting OK\n"
1287: + " function goto(userID) \n"
1288: + " {\n"
1289: + " window.theForm2.action = 'testPage.html'; //Rewriting fails\n"
1290: + " }\n" + "</script>\n";
1291:
1292: String lExpectation = "<script language=\"JavaScript\">\n"
1293: + " window.theForm1.action = 'http://rajanagendra.sun.com/Base/Raja/testPage.html'; //rewriting OK\n"
1294: + " function goto(userID) \n"
1295: + " {\n"
1296: + " window.theForm2.action = 'http://rajanagendra.sun.com/Base/Raja/testPage.html'; //Rewriting fails\n"
1297: + " }\n" + "</script>\n";
1298:
1299: String lJSVarRules = "<Variable name=\"*action\" type=\"EXPRESSION\"/>";
1300:
1301: RuleSet lRuleSet = CreateRuleSet
1302: .withJSVariableRules(lJSVarRules);
1303: Rewriter lRewriter = RewriterPool.create(lRuleSet,
1304: LanguageConstants.HTML_MIME);
1305: String lResult = lRewriter.rewrite(lInput,
1306: getDefaultTranslator());
1307: assertEquals(lExpectation, lResult);
1308: }//testGoTOKeyWordInFunctions()
1309:
1310: public void testBugNo4795370GoTOKeyWordInFunctionsVarient1()
1311: throws Exception {
1312: String lInput = "<script language=\"JavaScript\">\n"
1313: + " window.theForm1.action = 'testPage.html'; //rewriting OK\n"
1314: + " function goto(userID) \n"
1315: + " {\n"
1316: + " goto('../true.html');\n"
1317: + " window.theForm2.action = 'testPage.html'; //Rewriting fails\n"
1318: + " }\n" + "</script>\n";
1319:
1320: String lExpectation = "<script language=\"JavaScript\">\n"
1321: + " window.theForm1.action = 'http://rajanagendra.sun.com/Base/Raja/testPage.html'; //rewriting OK\n"
1322: + " function goto(userID) \n"
1323: + " {\n"
1324: + " goto('http://rajanagendra.sun.com/Base/true.html');\n"
1325: + " window.theForm2.action = 'http://rajanagendra.sun.com/Base/Raja/testPage.html'; //Rewriting fails\n"
1326: + " }\n" + "</script>\n";
1327:
1328: String lJSVarRules = "<Variable name=\"*action\" type=\"EXPRESSION\"/>";
1329: String lJSFunRule = "<Function type=\"EXPRESSION\" name=\"goto\" paramPatterns=\"y\"/>";
1330:
1331: RuleSet lRuleSet = CreateRuleSet
1332: .withHTMLJSTokenJSVarJSFunRules("", lJSVarRules,
1333: lJSFunRule);
1334: Rewriter lRewriter = RewriterPool.create(lRuleSet,
1335: LanguageConstants.HTML_MIME);
1336: String lResult = lRewriter.rewrite(lInput,
1337: getDefaultTranslator());
1338: assertEquals(lExpectation, lResult);
1339: }//testGoTOKeyWordInFunctionsVarient1()
1340:
1341: public void testBugNo4795370GoTOKeyWordInFunctionsAndVariables()
1342: throws Exception {
1343: String lInput = "<script language=\"JavaScript\">\n"
1344: + " window.theForm1.action = 'testPage.html'; // rewriting OK\n"
1345: + " var goto = \"rarara\";\n"
1346: + " window.theForm2.action = 'testPage.html'; // Rewriting fails\n"
1347: + "</script>\n"
1348: + "<script language=\"JavaScript\">\n"
1349: + " window.theForm1.action = 'testPage.html'; //rewriting OK\n"
1350: + " function goto(userID) \n"
1351: + " {\n"
1352: + " window.theForm2.action = 'testPage.html'; //Rewriting fails\n"
1353: + " }\n" + "</script>\n";
1354:
1355: String lExpectation = "<script language=\"JavaScript\">\n"
1356: + " window.theForm1.action = 'http://rajanagendra.sun.com/Base/Raja/testPage.html'; // rewriting OK\n"
1357: + " var goto = \"rarara\";\n"
1358: + " window.theForm2.action = 'http://rajanagendra.sun.com/Base/Raja/testPage.html'; // Rewriting fails\n"
1359: + "</script>\n"
1360: + "<script language=\"JavaScript\">\n"
1361: + " window.theForm1.action = 'http://rajanagendra.sun.com/Base/Raja/testPage.html'; //rewriting OK\n"
1362: + " function goto(userID) \n"
1363: + " {\n"
1364: + " window.theForm2.action = 'http://rajanagendra.sun.com/Base/Raja/testPage.html'; //Rewriting fails\n"
1365: + " }\n" + "</script>\n";
1366:
1367: String lJSVarRules = "<Variable name=\"*action\" type=\"EXPRESSION\"/>";
1368:
1369: RuleSet lRuleSet = CreateRuleSet
1370: .withJSVariableRules(lJSVarRules);
1371: Rewriter lRewriter = RewriterPool.create(lRuleSet,
1372: LanguageConstants.HTML_MIME);
1373: String lResult = lRewriter.rewrite(lInput,
1374: getDefaultTranslator());
1375: assertEquals(lExpectation, lResult);
1376: }//testGoTOKeyWordInFunctionsAndVariables()
1377:
1378: public void testBugNo4795370GoTOKeyWordInFunctionsAndVariables1()
1379: throws Exception {
1380: String lInput = "<script language=\"JavaScript\">\n"
1381: + " window.theForm1.action = 'testPage.html'; //rewriting OK\n"
1382: + " function goto(userID) \n"
1383: + " {\n"
1384: + " window.theForm2.action = 'testPage.html'; //Rewriting fails\n"
1385: + " }\n"
1386: + "</script>\n"
1387: + "<script language=\"JavaScript\">\n"
1388: + " window.theForm1.action = 'testPage.html'; // rewriting OK\n"
1389: + " var goto = \"rarara\";\n"
1390: + " window.theForm2.action = 'testPage.html'; // Rewriting fails\n"
1391: + "</script>\n";
1392:
1393: String lExpectation = "<script language=\"JavaScript\">\n"
1394: + " window.theForm1.action = 'http://rajanagendra.sun.com/Base/Raja/testPage.html'; //rewriting OK\n"
1395: + " function goto(userID) \n"
1396: + " {\n"
1397: + " window.theForm2.action = 'http://rajanagendra.sun.com/Base/Raja/testPage.html'; //Rewriting fails\n"
1398: + " }\n"
1399: + "</script>\n"
1400: + "<script language=\"JavaScript\">\n"
1401: + " window.theForm1.action = 'http://rajanagendra.sun.com/Base/Raja/testPage.html'; // rewriting OK\n"
1402: + " var goto = \"rarara\";\n"
1403: + " window.theForm2.action = 'http://rajanagendra.sun.com/Base/Raja/testPage.html'; // Rewriting fails\n"
1404: + "</script>\n";
1405:
1406: String lJSVarRules = "<Variable name=\"*action\" type=\"EXPRESSION\"/>";
1407:
1408: RuleSet lRuleSet = CreateRuleSet
1409: .withJSVariableRules(lJSVarRules);
1410: Rewriter lRewriter = RewriterPool.create(lRuleSet,
1411: LanguageConstants.HTML_MIME);
1412: String lResult = lRewriter.rewrite(lInput,
1413: getDefaultTranslator());
1414: assertEquals(lExpectation, lResult);
1415: }//testGoTOKeyWordInFunctionsAndVariables1()
1416:
1417: public void testBugNo4721347EscapedJSLineInWindowsUnixFiles()
1418: throws Exception {
1419: String[] lFileNames = {
1420: "/com/sun/portal/rewriter/test/samples/html/Bug4721347/Source4Bug4721347Windows.js",
1421: "/com/sun/portal/rewriter/test/samples/html/Bug4721347/Source4Bug4721347Unix.js", };
1422:
1423: for (int i = 0; i < lFileNames.length; i++) {
1424: String lInput = Resource.read(lFileNames[i]);
1425: lInput = lInput + "var abc = 'abc.html'";
1426:
1427: String lExpectation = "function runMe(fieldname)\n"
1428: + "{\n"
1429: + "\n"
1430: + " var html ; \n"
1431: + "\n"
1432: + " html = '<img src=\"' + 'webguiMimeURL' + '/webgui/'+'webguiTheme'+'/images/buttons/tanicon.gif\" style=\"width:17;height:17\" onmouseout=\"status=\\' \\';\" onmouseover=\"status=\\'?\\';\" onclick=\"javascript:webguiRaiseSearchhelp(\\'' + fieldname + '\\')\">';\n"
1433: + "\n"
1434: + " return (html) ;\n"
1435: + "}\n"
1436: + "\n\nvar abc = 'http://rajanagendra.sun.com/Base/Raja/abc.html'";
1437:
1438: String lJSVarRules = "<Variable name=\"abc\"/>"
1439: + "<Variable name=\"html\" type=\"DHTML\"/>";
1440: RuleSet lRuleSet = CreateRuleSet
1441: .withJSVariableRules(lJSVarRules);
1442: Rewriter lRewriter = RewriterPool.create(lRuleSet,
1443: LanguageConstants.JS_MIME);
1444: String lResult = lRewriter.rewrite(lInput,
1445: getDefaultTranslator());
1446: assertEquals(lExpectation, lResult);
1447: }
1448: }//testBugNo4721347EscapedJSLineInWindowsUnixFiles()
1449:
1450: public void ignoreTestJSWithI18NStrings() throws Exception {
1451: String[] lFileNames = { "/com/sun/portal/rewriter/test/samples/html/JSPageWithJapanisChars.html", };
1452:
1453: for (int i = 0; i < lFileNames.length; i++) {
1454: String lInput = Resource.read(lFileNames[i]);
1455:
1456: String lExpectation = "<html>\n"
1457: + JSWrapperHelper.CONVERT_EXPRESSION_FUNCTION_HTML
1458: + Resource.read(lFileNames[i] + ".result");
1459:
1460: String lHTMLAttRules = "<Attribute name=\" HReF \" />";
1461:
1462: String lJSFunRules = "<Function type=\"EXPRESSION\" name=\"*AddFavorite\" paramPatterns=\"y\"/>";
1463:
1464: RuleSet lRuleSet = CreateRuleSet
1465: .withHTMLAttJSVarJSFunRules(lHTMLAttRules, "",
1466: lJSFunRules);
1467: Rewriter lRewriter = RewriterPool.create(lRuleSet,
1468: LanguageConstants.HTML_MIME);
1469: String lResult = lRewriter.rewrite(lExpectation,
1470: getDefaultTranslator());
1471: assertEquals(lExpectation, lResult);
1472: }
1473: }//testJSWithI18NStrings()
1474:
1475: public void testBug4890520() throws Exception {
1476: String lInput = "var seamonkey, opera, ie, nn = false;\n"
1477: + "var browsername = \"Netscape\";\n"
1478: + "var ua = window.navigator.userAgent;\n"
1479: + "var version = navigator.appVersion;\n"
1480: + "/* which browser */\n"
1481: + "if (ua.indexOf(\"MSIE\") >= 0) {browsername=\"Microsoft\";}\n"
1482: + "if (ua.indexOf(\"Opera\") >= 0) {browsername=\"Opera\";}\n"
1483: + "/* Which version number */\n"
1484: + "if (ua.indexOf(\"/4.\") > 0) {version=4;}\n"
1485: + "if (ua.indexOf(\"/5.\") > 0) {version=5;}\n"
1486: + "if (ua.indexOf(\"MSIE 5.\") > 0) {version=5;}\n"
1487: + "/* Put it all together */\n"
1488: + "if (browsername == \"Microsoft\") {ie=true;}\n"
1489: + "if (browsername == \"Opera\") {opera=true;}\n"
1490: + "if (browsername == \"Netscape\" && version == 4) {nn=true;}\n"
1491: + "if (browsername == \"Netscape\" && version == 5) {seamonkey=true;}\n"
1492: + "/* start menu configuration */\n"
1493: + "var cssPath = \"\";\n"
1494: + "cssPath = \"/\";\n"
1495: + "var jsPath = \"\";\n"
1496: + "var jsPath = \"/\";\n"
1497: + "var jsPath = \"/abc.html\";\n"
1498: + "var application = \"intranet\";\n"
1499: + "var menuSkin = \"inside\";\n"
1500: + "var writeDate = \"true\";\n"
1501: + "var activeBranch = 1;\n"
1502: + "var language = \"null\";\n"
1503: + "var menuType = \"leftmenu\";\n"
1504: + "/* end menu configuration */\n"
1505: + "/* include the correct files */\n"
1506: + "if (ie) {\n"
1507: + " document.write(\"<link rel='stylesheet' href='\"+cssPath+\"menu_\" + application + \"_ie.css'>\");\n"
1508: + " document.write(\"<script language='javascript' src='\"+jsPath+menuType+\"'></script>\");\n"
1509: + " document.write(\"<script language='javascript' src='\"+jsPath+menuType+\"_ie.js'></script>\");\n"
1510: + "}\n"
1511: + "if (opera) {\n"
1512: + " document.write(\"<link rel='stylesheet' href='\"+cssPath+\"menu_\" + application + \"_ie.css'>\");\n"
1513: + " document.write(\"<script language='javascript' src='\"+jsPath+menuType+\"_mozilla.js'></script>\");\n"
1514: + "}\n"
1515: + "if (nn) {\n"
1516: + " document.write(\"<script language='javascript' src='\"+cssPath+\"menu_\" + application + \"_nn4.css'></script>\");\n"
1517: + " document.write(\"<script language='javascript' src='\"+jsPath+menuType+\"_nn4.js'></script>\");\n"
1518: + "}\n"
1519: + "if (seamonkey) {\n"
1520: + " document.write(\"<link rel='stylesheet' href='\"+cssPath+\"menu_\" + application + \"_mozilla.css'>\");\n"
1521: + " document.write(\"<script language='javascript' src='\"+jsPath+menuType + \"_mozilla.js'></script>\");\n"
1522: + " document.write(\"<script language='javascript' src='abc.html\"+jsPath+menuType + \"_mozilla.js'></script>\");\n"
1523: + "}\n";
1524:
1525: String lExpectation = "var seamonkey, opera, ie, nn = false;\n"
1526: + "var browsername = \"Netscape\";\n"
1527: + "var ua = window.navigator.userAgent;\n"
1528: + "var version = navigator.appVersion;\n"
1529: + "/* which browser */\n"
1530: + "if (ua.indexOf(\"MSIE\") >= 0) {browsername=\"Microsoft\";}\n"
1531: + "if (ua.indexOf(\"Opera\") >= 0) {browsername=\"Opera\";}\n"
1532: + "/* Which version number */\n"
1533: + "if (ua.indexOf(\"/4.\") > 0) {version=4;}\n"
1534: + "if (ua.indexOf(\"/5.\") > 0) {version=5;}\n"
1535: + "if (ua.indexOf(\"MSIE 5.\") > 0) {version=5;}\n"
1536: + "/* Put it all together */\n"
1537: + "if (browsername == \"Microsoft\") {ie=true;}\n"
1538: + "if (browsername == \"Opera\") {opera=true;}\n"
1539: + "if (browsername == \"Netscape\" && version == 4) {nn=true;}\n"
1540: + "if (browsername == \"Netscape\" && version == 5) {seamonkey=true;}\n"
1541: + "/* start menu configuration */\n"
1542: + "var cssPath = \"\";\n"
1543: + "cssPath = \"http://rajanagendra.sun.com/\";\n"
1544: + "var jsPath = \"\";\n"
1545: + "var jsPath = \"http://rajanagendra.sun.com/\";\n"
1546: + "var jsPath = \"http://rajanagendra.sun.com/abc.html\";\n"
1547: + "var application = \"intranet\";\n"
1548: + "var menuSkin = \"inside\";\n"
1549: + "var writeDate = \"true\";\n"
1550: + "var activeBranch = 1;\n"
1551: + "var language = \"null\";\n"
1552: + "var menuType = \"leftmenu\";\n"
1553: + "/* end menu configuration */\n"
1554: + "/* include the correct files */\n" + "if (ie) {\n"
1555: + " document.write(\"<link rel='stylesheet' href='\"+"
1556: + JSWrapperHelper.CONVERT_EXPRESSION_FUNCTION_WRAP_START
1557: + "cssPath)+\"menu_\" + application + \"_ie.css'>\");\n"
1558: + " document.write(\"<script language='javascript' src='\"+"
1559: + JSWrapperHelper.CONVERT_EXPRESSION_FUNCTION_WRAP_START
1560: + "jsPath)+menuType+\"'></script>\");\n"
1561: + " document.write(\"<script language='javascript' src='\"+"
1562: + JSWrapperHelper.CONVERT_EXPRESSION_FUNCTION_WRAP_START
1563: + "jsPath)+menuType+\"_ie.js'></script>\");\n"
1564: + "}\n"
1565: + "if (opera) {\n"
1566: + " document.write(\"<link rel='stylesheet' href='\"+"
1567: + JSWrapperHelper.CONVERT_EXPRESSION_FUNCTION_WRAP_START
1568: + "cssPath)+\"menu_\" + application + \"_ie.css'>\");\n"
1569: + " document.write(\"<script language='javascript' src='\"+"
1570: + JSWrapperHelper.CONVERT_EXPRESSION_FUNCTION_WRAP_START
1571: + "jsPath)+menuType+\"_mozilla.js'></script>\");\n"
1572: + "}\n"
1573: + "if (nn) {\n"
1574: + " document.write(\"<script language='javascript' src='\"+"
1575: + JSWrapperHelper.CONVERT_EXPRESSION_FUNCTION_WRAP_START
1576: + "cssPath)+\"menu_\" + application + \"_nn4.css'></script>\");\n"
1577: + " document.write(\"<script language='javascript' src='\"+"
1578: + JSWrapperHelper.CONVERT_EXPRESSION_FUNCTION_WRAP_START
1579: + "jsPath)+menuType+\"_nn4.js'></script>\");\n"
1580: + "}\n"
1581: + "if (seamonkey) {\n"
1582: + " document.write(\"<link rel='stylesheet' href='\"+"
1583: + JSWrapperHelper.CONVERT_EXPRESSION_FUNCTION_WRAP_START
1584: + "cssPath)+\"menu_\" + application + \"_mozilla.css'>\");\n"
1585: + " document.write(\"<script language='javascript' src='\"+"
1586: + JSWrapperHelper.CONVERT_EXPRESSION_FUNCTION_WRAP_START
1587: + "jsPath)+menuType + \"_mozilla.js'></script>\");\n"
1588: + " document.write(\"<script language='javascript' src='http://rajanagendra.sun.com/Base/Raja/abc.html\"+"
1589: + JSWrapperHelper.CONVERT_EXPRESSION_FUNCTION_WRAP_START
1590: + "jsPath)+menuType + \"_mozilla.js'></script>\");\n"
1591: + "}\n"
1592: + JSWrapperHelper.CONVERT_EXPRESSION_FUNCTION_JS;
1593:
1594: String lHTMLAttRules = "<Attribute name=\"href\"/>"
1595: + "<Attribute name=\"src\"/>";
1596:
1597: String[] lJSVarRules = {
1598: "<Variable name=\"imgx*;jsPath;css*th\" type=\"EXPRESSION\"/>",
1599: "<Variable name=\"css*th\" type=\"EXPRESSION\"/>"
1600: + "<Variable name=\"js*th\" type=\"EXPRESSION\"/>",
1601:
1602: "<Variable name=\"cssPath\" type=\"EXPRESSION\"/>"
1603: + "<Variable name=\"jsPath\" type=\"EXPRESSION\"/>", };
1604:
1605: String lJSFunRules = "<Function type=\"DHTML\" name=\"document.write\" paramPatterns=\"y\"/>";
1606:
1607: for (int i = 0; i < lJSVarRules.length; i++) {
1608: RuleSet lRuleSet = CreateRuleSet
1609: .withHTMLAttJSVarJSFunRules(lHTMLAttRules,
1610: lJSVarRules[i], lJSFunRules);
1611: Rewriter lRewriter = RewriterPool.create(lRuleSet,
1612: LanguageConstants.JS_MIME);
1613: String lResult = lRewriter.rewrite(lInput,
1614: getDefaultTranslator());
1615: assertEquals(lResult, lExpectation, lResult);
1616: }
1617: }//testBug4890520()
1618:
1619: public void testBug4890520Varient() throws Exception {
1620: String lInput = "var jsPath = \"\";\n"
1621: + "var jsPath = \"/abc.html\";\n"
1622: + " document.write(\"<script language='javascript' src='\"+jsPath+menuType'></script>\");\n";
1623:
1624: String lExpectation = "var jsPath = \"\";\n"
1625: + "var jsPath = \"http://rajanagendra.sun.com/abc.html\";\n"
1626: + " document.write(\"<script language='javascript' src='\"+"
1627: + JSWrapperHelper.CONVERT_EXPRESSION_FUNCTION_WRAP_START
1628: + "jsPath)+menuType'></script>\");\n"
1629: + JSWrapperHelper.CONVERT_EXPRESSION_FUNCTION_JS;
1630:
1631: String lHTMLAttRules = "<Attribute name=\"href\"/>"
1632: + "<Attribute name=\"src\"/>";
1633:
1634: String[] lJSVarRules = {
1635: "<Variable name=\"imgx*;jsPath;css*th\" type=\"EXPRESSION\"/>",
1636: "<Variable name=\"css*th\" type=\"EXPRESSION\"/>"
1637: + "<Variable name=\"js*th\" type=\"EXPRESSION\"/>",
1638:
1639: "<Variable name=\"cssPath\" type=\"EXPRESSION\"/>"
1640: + "<Variable name=\"jsPath\" type=\"EXPRESSION\"/>",
1641:
1642: "<Variable name=\"cssPath\" type=\"URL\"/>"
1643: + "<Variable name=\"jsPath\" type=\"EXPRESSION\"/>",
1644:
1645: "<Variable name=\"cssPath\" type=\"EXPRESSION\"/>"
1646: + "<Variable name=\"jsPath\" type=\"EXPRESSION\"/>",
1647:
1648: "<Variable name=\"cssPath\" type=\"URL\"/>"
1649: + "<Variable name=\"jsPath\" type=\"EXPRESSION\"/>", };
1650:
1651: String[] lJSVarRulesshouldwork = {
1652: "<Variable name=\"imgx*;jsPath;css*th\" type=\"EXPRESSION\"/>",
1653: "<Variable name=\"imgx*;jsPath;css*th\" type=\"URL\"/>",
1654: "<Variable name=\"css*th\" type=\"EXPRESSION\"/>"
1655: + "<Variable name=\"js*th\" type=\"EXPRESSION\"/>",
1656:
1657: "<Variable name=\"cssPath\" type=\"EXPRESSION\"/>"
1658: + "<Variable name=\"jsPath\" type=\"EXPRESSION\"/>",
1659:
1660: "<Variable name=\"cssPath\" type=\"URL\"/>"
1661: + "<Variable name=\"jsPath\" type=\"EXPRESSION\"/>",
1662:
1663: "<Variable name=\"cssPath\" type=\"EXPRESSION\"/>"
1664: + "<Variable name=\"jsPath\" type=\"URL\"/>",
1665:
1666: "<Variable name=\"cssPath\" type=\"URL\"/>"
1667: + "<Variable name=\"jsPath\" type=\"URL\"/>", };
1668:
1669: String lJSFunRules = "<Function type=\"DHTML\" name=\"document.write\" paramPatterns=\"y\"/>";
1670:
1671: for (int i = 0; i < lJSVarRules.length; i++) {
1672: RuleSet lRuleSet = CreateRuleSet
1673: .withHTMLAttJSVarJSFunRules(lHTMLAttRules,
1674: lJSVarRules[i], lJSFunRules);
1675: Rewriter lRewriter = RewriterPool.create(lRuleSet,
1676: LanguageConstants.JS_MIME);
1677: String lResult = lRewriter.rewrite(lInput,
1678: getDefaultTranslator());
1679: assertEquals(lResult, lExpectation, lResult);
1680: }
1681: }//testBug4890520Varient()
1682:
1683: public void testBug4898369BasetagProblem() throws Exception {
1684: String lInput = "<html>\n" + "<head>\n"
1685: + "<BASE HREF=\"http://xyz.com/basetag.htm\"/>\n"
1686: + "</head>\n" + "<script>\n"
1687: + "var jsScript=\"somevalue\";\n" + "</script>\n"
1688: + "<body>\n" + "</body>\n" + "</html>";
1689:
1690: String lExpectation = "<html>\n" + "<head>\n"
1691: + "<!-- BASE HREF=\"http://xyz.com/basetag.htm\" -->\n"
1692: + "</head>\n" + "<script>\n"
1693: + "var jsScript=\"http://xyz.com/somevalue\";\n"
1694: + "</script>\n" + "<body>\n" + "</body>\n" + "</html>";
1695:
1696: String lJsRules = "<Variable name=\"jsScript\" type=\"URL\" source=\"*formbug.html*\"/>";
1697:
1698: RuleSet lRuleSet = CreateRuleSet.withJSVariableRules(lJsRules);
1699: Rewriter lRewriter = RewriterPool.create(lRuleSet,
1700: LanguageConstants.HTML_MIME);
1701: Translator lTranslator = new AbsoluteTranslator(
1702: new PageSpec(
1703: "http://rajanagendra.sun.com/Base/Raja/formbug.html?name=formbug"));
1704: String lResult = lRewriter.rewrite(lInput, lTranslator);
1705: assertEquals(lExpectation, lResult);
1706: }//testBug4898369BasetagProblem()
1707:
1708: public static void main(String[] args) {
1709: RewriterModule.initFile();
1710: //BasicTestCase.run( TestJSGeneralTwo.class );
1711: TestSuite testSuite = new TestSuite();
1712: testSuite.addTest(new TestJSGeneralTwo(
1713: "testBug4898369BasetagProblem"));
1714: BasicTestCase.run(testSuite);
1715: }//main()
1716:
1717: }//class TestJSGeneralTwo
|