This question has bothered me for a million years... whenever I create a website with a textarea that allows multi-line (such as a "Bio" for a user's profile) I always end up writing the following paranoid code:
// C# code sample...
bio = bio.Replace("
", "
").Replace("
", "
");
bio = Regex.Replace(@"
{2,}", "
");
So, what do browsers send up for a <textarea name="Bio"></textarea>
if it has multiple lines?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…