diff options
| author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-08-24 18:37:53 +0100 |
|---|---|---|
| committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-08-24 18:37:53 +0100 |
| commit | 6ba23344c95157793af9e4154933ae8df61630e8 (patch) | |
| tree | e12956cbe7a0082bbaaa545cb80d9e86b13f88e8 /indra/llui/lltextvalidate.cpp | |
| parent | 01d06a3572c533f810f8f42e7ae9c55051f34aaf (diff) | |
| parent | 46e6135eef90b7ff0f08b12384a9aafc1a3e91e1 (diff) | |
merge heads. whew.
Diffstat (limited to 'indra/llui/lltextvalidate.cpp')
| -rw-r--r-- | indra/llui/lltextvalidate.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/indra/llui/lltextvalidate.cpp b/indra/llui/lltextvalidate.cpp index d7260369ec..4b9faa0560 100644 --- a/indra/llui/lltextvalidate.cpp +++ b/indra/llui/lltextvalidate.cpp @@ -44,6 +44,7 @@ namespace LLTextValidate declare("alpha_num_space", validateAlphaNumSpace); declare("ascii_printable_no_pipe", validateASCIIPrintableNoPipe); declare("ascii_printable_no_space", validateASCIIPrintableNoSpace); + declare("ascii_with_newline", validateASCIIWithNewLine); } // Limits what characters can be used to [1234567890.-] with [-] only valid in the first position. @@ -293,4 +294,21 @@ namespace LLTextValidate } return rv; } + + // Used for multiline text stored on the server. + // Example is landmark description in Places SP. + bool validateASCIIWithNewLine(const LLWString &str) + { + bool rv = TRUE; + S32 len = str.length(); + while(len--) + { + if (str[len] < 0x20 && str[len] != 0xA || str[len] > 0x7f) + { + rv = FALSE; + break; + } + } + return rv; + } } |
