diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llfloaterpostcard.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/linden/indra/newview/llfloaterpostcard.cpp b/linden/indra/newview/llfloaterpostcard.cpp index b4bcdb7..4be8145 100644 --- a/linden/indra/newview/llfloaterpostcard.cpp +++ b/linden/indra/newview/llfloaterpostcard.cpp | |||
@@ -63,6 +63,8 @@ | |||
63 | 63 | ||
64 | #include "llassetuploadresponders.h" | 64 | #include "llassetuploadresponders.h" |
65 | 65 | ||
66 | #include <boost/regex.hpp> //boost.regex lib | ||
67 | |||
66 | ///---------------------------------------------------------------------------- | 68 | ///---------------------------------------------------------------------------- |
67 | /// Local function declarations, constants, enums, and typedefs | 69 | /// Local function declarations, constants, enums, and typedefs |
68 | ///---------------------------------------------------------------------------- | 70 | ///---------------------------------------------------------------------------- |
@@ -180,7 +182,7 @@ void LLFloaterPostcard::draw() | |||
180 | rect.mBottom = (S32)((F32)rect.mTop - ((F32)rect.getWidth() / ratio)); | 182 | rect.mBottom = (S32)((F32)rect.mTop - ((F32)rect.getWidth() / ratio)); |
181 | } | 183 | } |
182 | { | 184 | { |
183 | LLGLSNoTexture gls_no_texture; | 185 | gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); |
184 | gl_rect_2d(rect, LLColor4(0.f, 0.f, 0.f, 1.f)); | 186 | gl_rect_2d(rect, LLColor4(0.f, 0.f, 0.f, 1.f)); |
185 | rect.stretch(-1); | 187 | rect.stretch(-1); |
186 | } | 188 | } |
@@ -242,14 +244,16 @@ void LLFloaterPostcard::onClickSend(void* data) | |||
242 | 244 | ||
243 | std::string from(self->childGetValue("from_form").asString()); | 245 | std::string from(self->childGetValue("from_form").asString()); |
244 | std::string to(self->childGetValue("to_form").asString()); | 246 | std::string to(self->childGetValue("to_form").asString()); |
245 | 247 | ||
246 | if (to.empty() || to.find('@') == std::string::npos) | 248 | boost::regex emailFormat("[A-Za-z0-9.%+-_]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"); |
249 | |||
250 | if (to.empty() || !boost::regex_match(to, emailFormat)) | ||
247 | { | 251 | { |
248 | gViewerWindow->alertXml("PromptRecipientEmail"); | 252 | gViewerWindow->alertXml("PromptRecipientEmail"); |
249 | return; | 253 | return; |
250 | } | 254 | } |
251 | 255 | ||
252 | if (from.empty() || from.find('@') == std::string::npos) | 256 | if (from.empty() || !boost::regex_match(from, emailFormat)) |
253 | { | 257 | { |
254 | gViewerWindow->alertXml("PromptSelfEmail"); | 258 | gViewerWindow->alertXml("PromptSelfEmail"); |
255 | return; | 259 | return; |