Fixed #392: email addresses are automatically obfuscated.

This commit is contained in:
Dario Solera 2009-10-22 13:47:37 +00:00
parent cb567df541
commit 16bcab85ea
3 changed files with 20 additions and 5 deletions

View file

@ -554,6 +554,21 @@ namespace ScrewTurn.Wiki {
return hash;
}
/// <summary>
/// Obfuscates text, replacing each character with its HTML escaped sequence, for example a becomes <c>&amp;#97;</c>.
/// </summary>
/// <param name="input">The input text.</param>
/// <returns>The output obfuscated text.</returns>
public static string ObfuscateText(string input) {
StringBuilder buffer = new StringBuilder(input.Length * 4);
foreach(char c in input) {
buffer.Append("&#" + ((int)c).ToString("D2") + ";");
}
return buffer.ToString();
}
}
/// <summary>