summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterpostcard.cpp
diff options
context:
space:
mode:
authorMark Palange <palange@lindenlab.com>2008-11-07 17:51:03 +0000
committerMark Palange <palange@lindenlab.com>2008-11-07 17:51:03 +0000
commitf89f19990cbb9f3f2e7473ac6c159098bdfabec7 (patch)
treee7fa406e2db5e9adc2e24e00557d7b3d3f93203a /indra/newview/llfloaterpostcard.cpp
parentb2bfb128e7d30e1cdb293a2ac192a0cbe63fe528 (diff)
QAR-992 Merging revisions 101012-101170,101686-101687 of svn+ssh://svn.lindenlab.com/svn/linden/qa/viewer_combo_1-22-merge into linden/release
Diffstat (limited to 'indra/newview/llfloaterpostcard.cpp')
-rw-r--r--indra/newview/llfloaterpostcard.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/indra/newview/llfloaterpostcard.cpp b/indra/newview/llfloaterpostcard.cpp
index d97023e256..3e12c2e47c 100644
--- a/indra/newview/llfloaterpostcard.cpp
+++ b/indra/newview/llfloaterpostcard.cpp
@@ -63,6 +63,8 @@
#include "llassetuploadresponders.h"
+#include <boost/regex.hpp> //boost.regex lib
+
///----------------------------------------------------------------------------
/// Local function declarations, constants, enums, and typedefs
///----------------------------------------------------------------------------
@@ -180,7 +182,7 @@ void LLFloaterPostcard::draw()
rect.mBottom = (S32)((F32)rect.mTop - ((F32)rect.getWidth() / ratio));
}
{
- LLGLSNoTexture gls_no_texture;
+ gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gl_rect_2d(rect, LLColor4(0.f, 0.f, 0.f, 1.f));
rect.stretch(-1);
}
@@ -242,14 +244,16 @@ void LLFloaterPostcard::onClickSend(void* data)
std::string from(self->childGetValue("from_form").asString());
std::string to(self->childGetValue("to_form").asString());
-
- if (to.empty() || to.find('@') == std::string::npos)
+
+ boost::regex emailFormat("[A-Za-z0-9.%+-_]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}");
+
+ if (to.empty() || !boost::regex_match(to, emailFormat))
{
gViewerWindow->alertXml("PromptRecipientEmail");
return;
}
- if (from.empty() || from.find('@') == std::string::npos)
+ if (from.empty() || !boost::regex_match(from, emailFormat))
{
gViewerWindow->alertXml("PromptSelfEmail");
return;