[xharness] Encode links better.

This commit is contained in:
Rolf Bjarne Kvinge 2017-02-08 11:46:14 +01:00
Родитель 3f7f1354f2
Коммит 8cf456cd0e
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -1501,7 +1501,7 @@ function oninitialload ()
log_target = "_self";
break;
}
writer.WriteLine ("<a href='{0}' type='{2}' target='{3}'>{1}</a><br />", System.Web.HttpUtility.UrlPathEncode (log.FullPath.Substring (LogDirectory.Length + 1)), log.Description, log_type, log_target);
writer.WriteLine ("<a href='{0}' type='{2}' target='{3}'>{1}</a><br />", LinkEncode (log.FullPath.Substring (LogDirectory.Length + 1)), log.Description, log_type, log_target);
if (log.Description == "Test log" || log.Description == "Execution log") {
var summary = string.Empty;
var fails = new List<string> ();
@ -1567,6 +1567,11 @@ function oninitialload ()
}
}
static string LinkEncode (string path)
{
return System.Web.HttpUtility.UrlEncode (path).Replace ("%2f", "/").Replace ("+", "%20");
}
string RenderTextStates (IEnumerable<TestTask> tests)
{
// Create a collection of all non-ignored tests in the group (unless all tests were ignored).