+
+2008-05-19 Noam Lampert <noaml@mainsoft.com>
+
+ * HttpServerUtility.cs: Fix bug in UrlPathEncode when URL contains '?'
+
2008-05-12 Noam Lampert <noaml@mainsoft.com>
* HttpApplication.cs: Fix regressions introduced by latest commit
int idx = s.IndexOf ("?");
string s2 = null;
if (idx != -1) {
- s2 = s.Substring (0, idx-1);
+ s2 = s.Substring (0, idx);
s2 = HttpUtility.UrlEncode (s2) + s.Substring (idx);
} else {
s2 = HttpUtility.UrlEncode (s);
windata = Encoding.Convert (Encoding.UTF8, win1251, utf8data);
Assert.AreEqual ("<script>", Encoding.ASCII.GetString (windata), "ok");
}
+
+ [Test]
+ public void UrlPathEncode2()
+ {
+ string s = "default.xxx?sdsd=sds";
+ string s2 = Server.UrlPathEncode(s);
+ Assert.AreEqual(s, s2, "UrlPathEncode " + s);
+ }
+
}
}
Assert.AreEqual (exp, act, "UrlPathEncode " + c.ToString ());
}
}
+ [Test]
+ public void UrlPathEncode2()
+ {
+ string s = "default.xxx?sdsd=sds";
+ string s2 = HttpUtility.UrlPathEncode(s);
+ Assert.AreEqual(s, s2, "UrlPathEncode " + s);
+ }
#endif